diozero icon indicating copy to clipboard operation
diozero copied to clipboard

Add example for ESP over Wifi and Arduino/ESP over serial

Open egeu5 opened this issue 2 years ago • 4 comments

Hello, I'm planning to use you're awesome project to teach kids in java. In my opinion this is a nice way to intruduct into object orientated programming - I like "physical" objects. I did not found any examples for ESP8266 over wifi or serial (or Arduino over serial). Is there any guide and I just did not found it? If not, please help me and I will add (after getting it working) a tutorial in you're docs.

Thank you! Chris

egeu5 avatar Jun 27 '22 14:06 egeu5

Hi Chris, very glad you find it useful.

I'd recommend you start with the Firmata section within the Remote Control page, apologies if this isn't obvious. Happy to provide further guidance if this still doesn't work - also any suggestions or updates to documentation would be greatly appreciated.

Regards, Matt

mattjlewis avatar Jun 27 '22 17:06 mattjlewis

Hi @mattjlewis , sorry for the late answear, I missed you're reply... I already uploaded the firmata firmware on an arduino an tried it with another Java Lib and I could turn on and off a LED. But I have no idea how to start on you're lib.

egeu5 avatar Aug 07 '22 18:08 egeu5

Easy if you are using Maven, as per the docs:

mvn archetype:generate -DarchetypeGroupId=com.diozero -DarchetypeArtifactId=diozero-application -DarchetypeVersion=1.3.3 -DgroupId=com.mycompany -DartifactId=mydiozeroapp -Dversion=1.0-SNAPSHOT

Then add this to the dependencies section in the created pom.xml:

		<dependency>
			<groupId>com.diozero</groupId>
			<artifactId>diozero-provider-firmata</artifactId>
			<version>1.3.3</version>
		</dependency>

The archetype creates a sample Java app that toggles an LED. Run this with app with the command line flag -Ddiozero.firmata.serialPort as per the Firmata instructions.

mattjlewis avatar Aug 08 '22 07:08 mattjlewis

FirmataBuilder does not provide an ESP32 WiFi configuration. Can anyone provide me with pointers on a working configuration ?

Ideally my devices would be DHCP-ed and the firmata would know the server hostname. I can also do the opposite and locate the DHCP addresses allocated to my ESP32s.

jflamy avatar Nov 07 '22 15:11 jflamy