How can I set up a communication between a Duet3 and an ESP32 ?
-
Hello,
I want to add quite a few sensors on my machine that are not natively supported by RRF3. I already added one using an ESP32 that I programmed and "communicate" with my Duet using 2 on/off ouptput that I routed on IOs on the Duet. It works great for the applications but it's clearly not scalable to others sensors.
I want to be able to "pull" sensors data from the ESP32 and be able to work with that value inside conditional gcode. I thought about using the SPI bus to communicate but I don't know if it's possible with RRF3.
What is your suggestions on the best way to do this ? Thanks
-
@e4d said in How can I set up a communication between a Duet3 and an ESP32 ?:
What is your suggestions on the best way to do this ?
It has to be ESP32?
A Sammy-C21 with CAN-FD would be an open platform for DIY hardware with RRF-connection -
@e4d There is a home assistant integration so if you use ESPHome you can pull a few things off the printer and use them with an ESP32. I do this to toggle some ESP32 controlled lights depending on Z position. Failing that, MQTT might be an option but I'm not sure how far RRF has progressed with that.
-
@o_lampe I'm not limited by the ESP32. I was hoping for something a bit easier than learning and modifying the firmware, that's why I went for this solution. I spent a couple of hours exploring RRF and my understanding is that I would need to modify the 6HC and 3HC firmware to be able to achieve my goal. It seems like quite a lot of work and not easy to do.
I also thought about another solution. Would it be possible to write a Python DSF plugins that create new items in the Object Model and put some values in it. Would it be easier to do so ? What are the big steps so I can document myself and think about the best way to do it ?
-
I think that you can send gcode commands from the ESP32 to the Duet to execute. Via HTTP or serial connection. I guess that this allows you to send gcode such as setting global variables that your conditional code can access. Others may know more details.