Hello Guest it is March 29, 2024, 03:21:16 AM

Author Topic: Mouse MPG Module  (Read 2421 times)

0 Members and 1 Guest are viewing this topic.

Re: Mouse MPG Module
« Reply #20 on: February 06, 2021, 05:24:57 PM »
Hey is that one of the Arduino but not really ESP866 boards? if so... I just got a few of them I was going to goof around with. I am way more than happy to code the TCP on my side and help with the source code. I know I can make this all work in Lua! I was able to talk to JRMI from MAch4 to run my son's train layout :)
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com
Re: Mouse MPG Module
« Reply #21 on: February 06, 2021, 10:47:51 PM »
Hey is that one of the Arduino but not really ESP866 boards? if so... I just got a few of them I was going to goof around with. I am way more than happy to code the TCP on my side and help with the source code. I know I can make this all work in Lua! I was able to talk to JRMI from MAch4 to run my son's train layout :)

The demo video I posted the device is using Bluetooth and acting like a keyboard in Windows so no TCP development necessary. The device is an ESP32, here is a giant Amazon link. You can get them cheaper if you shop around.

Code: [Select]
https://www.amazon.com/HiLetgo-ESP-WROOM-32-Development-Microcontroller-Integrated/dp/B0718T232Z/ref=sr_1_1_sspa?dchild=1&keywords=esp32&qid=1612668987&sr=8-1-spons&psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUFVUkxSR00yT1RVUVkmZW5jcnlwdGVkSWQ9QTA2MDg5NzkyQVo5NjkwUDNHTkczJmVuY3J5cHRlZEFkSWQ9QTAyMDg0MzEyTzNRU1ZWVFJUQTFOJndpZGdldE5hbWU9c3BfYXRmJmFjdGlvbj1jbGlja1JlZGlyZWN0JmRvTm90TG9nQ2xpY2s9dHJ1ZQ==
I'm not sure if the ESP8266 has bluetooth but if it does, it should work the same it's just a slower processor.

There is no LUA code necessary except updating the signal library, thanks to your update to the keyboard plugin, all the inputs are going through the keyboard plugin.

I just barely completed this, but here is firmware and the Mach4 auto installer: https://github.com/kethort/esp32-bluetooth-cnc-mpg-mach4

The MPGInstaller.exe in the dist folder will auto install all the settings and the plugin into Mach4, you just need to select the Mach4 directory and profile and hit install.

The MPGInstaller.exe will overwrite inputs 55 to 63 in Mach4 input config.

In the video, I am using rotary analog knobs, they are not typical switch knobs so there are two different versions of the firmware. In the Arduino folder of the repo there are two sketches. The one with analog is the only one I've been able to test so far. The other sketch is for regular switch knobs.

If you have a regular switch knob, the firmware is programmed so the inputs react to a ground signal (inputs are pullups).

You need two Arduino libraries which I linked in the repo and you also need to know how to program the ESP but I assume you already know how to if you own some ESP's already. I'll probably be updating the repo with instructions but you can find similar instructions for using the installer in another project I worked on here: https://github.com/kethort/esp32-cnc-mpg-handwheel-conversion-mach4

The input hardware mapping in the (Arduino) firmware is shown in the sharp defines in the top of the sketch.

If you get this working and test and find issues let me know I'll try to fix it.
 
« Last Edit: February 06, 2021, 10:58:01 PM by compewter_numerical »
Re: Mouse MPG Module
« Reply #22 on: February 06, 2021, 11:49:09 PM »
Forgot to mention, the MPGInstaller.exe will also automatically edit the screen and put in the LUA code for the signal library. 
Re: Mouse MPG Module
« Reply #23 on: February 07, 2021, 06:49:35 AM »
Ahh I have some of the esp32’s, I want to use Ethernet :) my problem is time but I love what you have done! Keep up the great work and if I can help I will donate some more time ;)
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com