That code is not designed to run on the esp32. Running serial on an esp32 chip does not really make sense in terms of driving a focuser.
You do understand that the myFocuserPro2 has already been updated to the next generation using an ESP8266 or ESP32 chip, giving all the features of Bluetooth (ESP32), WiFi, ASCOM REMOTE and a host of other features, options.
myFP2ESP WiFi was not designed to work as a serial usb controller (though that is possible).
The firmware for it was designed from scratch, and now has been ported over to myFocuserPro2
myFP2ESP controllers use the same protocol commands and responses as a myFocuserPro2
So if a myFP2ESP controller is running in LOCALSERIAL mode it will talk happily over USB with the myFocuserPro2 Windows app, myFocuserPro2 ASCOM driver andpresumably the INDI driver (as I do not have a LINUX system running INDI that I cannot verify but it should).
myFocuserPro2Linux is just a Linux version of the myFocuserPro2 Windows app designed to work over a serial port connection. It does not use TCPIP
Actually, taking the existing INDI driver for myFocuserPro2, it should be able to be modified (clone and then rename to myFocuserPro2ESP?) to use TCPIP instead of serial to communicate with the myFP2ESP controller - most of the INDI code is already done, just change the serial code to use TCPIP instead. Happy to provide source code examples of Linkux TCPIP socket code talking to an myFP2ESP controller to anyone interested in coding a driver,
If the command set is the same for the TCP connection, then it might be easy by changing
setSupportedConnections(CONNECTION_SERIAL) to setSupportedConnections(CONNECTION_SERIAL | CONNECTION_TCP)
That should make it possible to choose in control panel between serial / tcp connection.
And probably a few changes to the sendcommand. (If the driver has been implemented from the skeleton)
Should be easy to emulate by just opening a listener on on the tcp port tho see how the driver sends the command. )
some update: changed that setSupportedConnections(CONNECTION_SERIAL | CONNECTION_TCP) and recompiled
then on linux used nc to do some tcp traffic on port 1026
nc -l -v 1026
from kstars configured myfocuser2 to ip adress and port 1026
Could see the the driver sending the first command (#03) but then got stuck in sending the answer.
Hi all, I have been reading the posts and I have to say excellent work.
I'm building a focuser based on the ESP32 board using the myFP2ESP code (thanks roberto). I want to eliminate another USD cable from my rig.
Just looking at MyFocuserPro2 in the indi control panel (I'm running the latest KStars v3.3.8 ) there is only a serial connection option.
I am wonder if (and if not, when) the TCP method has been pushed for use yet?
Takahashi FC-100DF refractor
ZWO ASI 071 imaging camera
ZWO ASI 120MM on 30mm guidescope
Skywatcher HEQ5 Pro mount with belt modification
Raspberry Pi 4 running Ubuntu 22.04LTS headless with KStars/indi
I made a windows controller emulator for the esp controller. If you run this on the windows pc it will start an emulator (and tell you the ip address) - you then can connect to it and it behaves just like a esp controller. I use it all the time for testing, running inside its own VM