ESP8266 Thread

Post Reply
L67GS
Posts: 707
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Location: Great Lakes Region, U.S.A
Has thanked: 212 times
Been thanked: 92 times
Contact:

ESP8266 Thread

Post by L67GS »

A while back I got a few ESP8266 modules but I haven't used them yet. Now I'd like to start playing with them some so I thought it would make an interesting topic so users could share any ideas or experiences they've had using ESP modules with Odroids.
So, anybody used them with an Odroid?

User avatar
rooted
Posts: 9002
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 745 times
Been thanked: 422 times
Contact:

Re: ESP8266 Thread

Post by rooted »

The only way I've used them in conjunction with Odroid is relaying OctoPrint status from a C4 to an esp8266 with display.

User avatar
mctom
Posts: 986
Joined: Wed Nov 11, 2020 4:44 am
languages_spoken: english, polish
ODROIDs: N2+, Game Advance, a few XU4
Location: Gdansk, Poland
Has thanked: 103 times
Been thanked: 123 times
Contact:

Re: ESP8266 Thread

Post by mctom »

If my understanding is correct, ESP8266 is the predecessor of ESP32, that is found in Smart Power 3.

I have no experience with ESPs (except of modifying existing code recently), and Smart Power 3 really could use Wi-Fi capabilities. So I'm really interested to see who knows what, and who should I nag for help if I choose to go on that quest. :D
I really hate that USB cable sticking out from the side...
Punk ain't no religious cult, punk means thinking for yourself!

Maintainer of PiStackMon

User avatar
joerg
Posts: 1422
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 104 times
Been thanked: 229 times
Contact:

Re: ESP8266 Thread

Post by joerg »

I am user of ESP8266 and ESP32. I use Sming to write code in C/C++ for it. With the ESP8266 I made one Wifi enabled control board for an alarm siren. It communicates by MQTT with the homeassistant that is running on a C2.
I use Sming as I don't like Arduino platform.
https://sming.readthedocs.io/en/latest/
These users thanked the author joerg for the post:
L67GS (Fri Nov 05, 2021 11:22 pm)

User avatar
mad_ady
Posts: 10156
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 632 times
Been thanked: 817 times
Contact:

Re: ESP8266 Thread

Post by mad_ady »

So I'm really interested to see who knows what, and who should I nag for help if I choose to go on that quest
I have two words for you: crashoverride.
These users thanked the author mad_ady for the post:
L67GS (Fri Nov 05, 2021 11:22 pm)

User avatar
rooted
Posts: 9002
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 745 times
Been thanked: 422 times
Contact:

Re: ESP8266 Thread

Post by rooted »

joerg wrote:I am user of ESP8266 and ESP32. I use Sming to write code in C/C++ for it. With the ESP8266 I made one Wifi enabled control board for an alarm siren. It communicates by MQTT with the homeassistant that is running on a C2.
I use Sming as I don't like Arduino platform.
https://sming.readthedocs.io/en/latest/
Very interesting, I have several lying about and wouldn't mind checking out Sming. Thanks for the link

L67GS
Posts: 707
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Location: Great Lakes Region, U.S.A
Has thanked: 212 times
Been thanked: 92 times
Contact:

Re: ESP8266 Thread

Post by L67GS »

I'm downloading Sming tonight, I knew this thread would be useful.
LDMicro does ESP too, I'll learn what I can about that as well.

User avatar
rooted
Posts: 9002
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 745 times
Been thanked: 422 times
Contact:

Re: ESP8266 Thread

Post by rooted »

I forgot I also use an esp8266 running wLED to relay video data to the KODI Hyperion add-on, it works really well.

L67GS
Posts: 707
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Location: Great Lakes Region, U.S.A
Has thanked: 212 times
Been thanked: 92 times
Contact:

Re: ESP8266 Thread

Post by L67GS »

Hmm, this could be more challenging.

Code: Select all

tom@tom-Latitude-E6420:~$ source /opt/sming/Tools/install.sh all
Unsupported distribution
tom@tom-Latitude-E6420:~$ cat /etc/os-release
NAME="Linux Mint"
VERSION="20.1 (Ulyssa)"

User avatar
joerg
Posts: 1422
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 104 times
Been thanked: 229 times
Contact:

Re: ESP8266 Thread

Post by joerg »

You can add this to install.sh:

Code: Select all

elif [ -n "$(grep Mint /etc/os-release)" ]; then
    DIST=debian
    PKG_INSTALL="sudo apt-get install -y"
I remember I had to do this years ago, as I also work with Linux Mint. :)
These users thanked the author joerg for the post:
L67GS (Sat Nov 06, 2021 9:34 pm)

L67GS
Posts: 707
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Location: Great Lakes Region, U.S.A
Has thanked: 212 times
Been thanked: 92 times
Contact:

Re: ESP8266 Thread

Post by L67GS »

joerg wrote:
Fri Nov 05, 2021 8:32 pm
I use Sming as I don't like Arduino platform.
https://sming.readthedocs.io/en/latest/
So you're running Eclipse CDT?

User avatar
joerg
Posts: 1422
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 104 times
Been thanked: 229 times
Contact:

Re: ESP8266 Thread

Post by joerg »

Yes I am working with Eclipse.
This would be the second step. First you should go to a sample and see if it compiles for you. Or do you have already done?
And also flashed the app to the ESP8266?
I usually make a copy of a sample that is somehow near what I want to do, eg. MqttClient_Hello and rename it to my project.
When this is working, then it can be imported as Existing Code As Makefile Project in Eclipse.
Bildschirmfoto vom 2021-11-06 17-22-24.png
Bildschirmfoto vom 2021-11-06 17-22-24.png (43.92 KiB) Viewed 527 times
In the properties of project must be set SMING_HOME and ESP_HOME:
Bildschirmfoto vom 2021-11-06 17-17-05.png
Bildschirmfoto vom 2021-11-06 17-17-05.png (95.51 KiB) Viewed 527 times
Then it should build from Eclipse, with right mouse click and Build Project.
These users thanked the author joerg for the post:
L67GS (Sun Nov 07, 2021 1:54 am)

L67GS
Posts: 707
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Location: Great Lakes Region, U.S.A
Has thanked: 212 times
Been thanked: 92 times
Contact:

Re: ESP8266 Thread

Post by L67GS »

Okay, I'll have to bring some stuff back from my lab today since I don't have internet there. Should be able to try it this weekend still but I did get Sming, Eclipse C++ & Eclipse C++ Embedded installed in mint.

L67GS
Posts: 707
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Location: Great Lakes Region, U.S.A
Has thanked: 212 times
Been thanked: 92 times
Contact:

Re: ESP8266 Thread

Post by L67GS »

I believe I can make a simple adapter to use the pl2303 serial adapter that I use on my C-series Odroids to program ESP01 modules. It's a 10K pull up resistor and a couple of switches for reset and flash, and a couple hunks of male / female headers. IF she doesn't come up with something for me to do after work tomorrow I'll pop into my lab and grab supplies. So far I haven't been able to communicate with one so hopefully the switches are the missing piece of the equation.

Also LDMicro is a bust, it only has limited support for ESP.

L67GS
Posts: 707
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Location: Great Lakes Region, U.S.A
Has thanked: 212 times
Been thanked: 92 times
Contact:

Re: ESP8266 Thread

Post by L67GS »

I made an adapter and then figured out my serial cable provides 5V, not 3.3V. I use that cable with my C0's and C1+ with no problem, BUT - I never connect the power wire as it holds power on and I can't cycle the power with it hooked up. It was advertised as 3.3v so I'm assuming the data is at 3.3V.
Anyway I ordered a cheap programmer that does ESP-01 ESP-01S ESP-07 ESP-07S ESP-12E ESP-12F ESP-12S and ESP-F so I should be in business soon.

L67GS
Posts: 707
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Location: Great Lakes Region, U.S.A
Has thanked: 212 times
Been thanked: 92 times
Contact:

Re: ESP8266 Thread

Post by L67GS »

My programmer came today, it's really nice and it was cheap! I played a tiny bit with it testing a couple ESP-01's and an ESP-12F. ESPTOOL is up and running, and I did some AT stuff. I have to prep for Thanksgiving dinner now : (, but hopefully this weekend I can get one online and try to use it as an access point for the Candice project, she's been nagging me about it.
These users thanked the author L67GS for the post:
mctom (Thu Nov 25, 2021 4:59 pm)

L67GS
Posts: 707
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Location: Great Lakes Region, U.S.A
Has thanked: 212 times
Been thanked: 92 times
Contact:

Re: ESP8266 Thread

Post by L67GS »

Finally struggling to get an ESP8266 soft AP. I'd be delighted to get to where I could connect to it and send a couple commands for today.

User avatar
joerg
Posts: 1422
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 104 times
Been thanked: 229 times
Contact:

Re: ESP8266 Thread

Post by joerg »

Witch development platform you are using? Sming? Arduino? Something else?
For Sming, there several examples in the folder 'samples'. For a soft AP, you can try 'BasicWiFi'. The soft AP is enabled.

Code: Select all


void init()
{
	Serial.begin(SERIAL_BAUD_RATE);
	Serial.systemDebugOutput(true); // Allow debug print to serial
	Serial.println(_F("Sming. Let's do smart things!"));

	// Set system ready callback method
	System.onReady(ready);

	// Soft access point
	WifiAccessPoint.enable(true);
	WifiAccessPoint.config(_F("Sming InternetOfThings"), nullptr, AUTH_OPEN);

	// Station - WiFi client
	WifiStation.enable(true);
	WifiStation.config(_F(WIFI_SSID), _F(WIFI_PWD));

	// Optional: Change IP addresses (and disable DHCP)
	WifiAccessPoint.setIP(IpAddress(192, 168, 2, 1));
	WifiStation.setIP(IpAddress(192, 168, 1, 171));

	// Optional: Print details of any incoming probe requests
	WifiEvents.onAccessPointProbeReqRecved([](int rssi, MacAddress mac) {
		Serial.print(_F("Probe request: RSSI = "));
		Serial.print(rssi);
		Serial.print(_F(", mac = "));
		Serial.println(mac);
	});

	// Print available access points
	WifiStation.startScan(listNetworks); // In Sming we can start network scan from init method without additional code

	// Set callback that should be triggered when we have assigned IP
	WifiEvents.onStationGotIP(connectOk);

	// Set callback that should be triggered if we are disconnected or connection attempt failed
	WifiEvents.onStationDisconnect(connectFail);
}

L67GS
Posts: 707
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Location: Great Lakes Region, U.S.A
Has thanked: 212 times
Been thanked: 92 times
Contact:

Re: ESP8266 Thread

Post by L67GS »

joerg wrote:
Sun Nov 28, 2021 3:30 am
Witch development platform you are using? Sming? Arduino? Something else?
For Sming, there several examples in the folder 'samples'. For a soft AP, you can try 'BasicWiFi'. The soft AP is enabled.
I'm using Arduino IDE, Sming was a bit heavy for me. I was reluctant to try Arduino IDE because I didn't want to deal with their "shetches" but it turns out "sketch" is kiddispeak for fairly normal looking C++. Arduino IDE has a pretty simple everything, so I've spent some time getting comfortable with it.

I've got a soft AP, and I can run code in the void so I'm working on getting MQTT working, then MQTT is something I can work with from inside C++ to retrieve data from the ESP.

L67GS
Posts: 707
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Location: Great Lakes Region, U.S.A
Has thanked: 212 times
Been thanked: 92 times
Contact:

Re: ESP8266 Thread

Post by L67GS »

Whew, I ended up using curl to check the URL in the ESP (an ESP01 right now since the pins are easier to access than the ESP12F).
I have a C++ program using curl to retrieve data over wifi (direct, no router) and turn it into a useable variable.
Quickly becoming annoyed at the adolescent Arduino stuff like assigning everything to a variable and then using the variable instead of just typing what you want like as in wiringpi!

Code: Select all


const int BUTTON=2;
const int LED=0  ;
int BUTTONState=0;
void setup() {
  // put your setup code here, to run once:
pinMode(LED,OUTPUT);
pinMode(BUTTON,INPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
BUTTONState=digitalRead(BUTTON);
if(BUTTONState==HIGH)
{
  digitalWrite(LED,HIGH);
}
else
{
  digitalWrite(LED,LOW);
}
}

L67GS
Posts: 707
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Location: Great Lakes Region, U.S.A
Has thanked: 212 times
Been thanked: 92 times
Contact:

Re: ESP8266 Thread

Post by L67GS »

Got all 13 inputs on an ESP12F working with the C++/curl solution so now I'm starting to work on using an ESP01 on Candice. So far it doesn't look promising to use it as a sort of USB dongle replacement for SSH but serial bridge shouldn't be a problem. The complication there is what to do on the computer side? I don't want to still have a serial converter running from USB to an ESP when there's wifi built in for minicom.

L67GS
Posts: 707
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Location: Great Lakes Region, U.S.A
Has thanked: 212 times
Been thanked: 92 times
Contact:

Re: ESP8266 Thread

Post by L67GS »

I don't want to start a new thread and searching yielded a ton of results, many of which just had the word "serial" in them. Does anyone remember a good thread on using serial data? I want to use minicom into a C0 (The Candice project) and send serial data out TXD1 & RXD1 to this ESP12 I've been playing with.
Initially I'd like to have a terminal direct line to just send commands while I learn, then try to use it as a serial bridge to the PC instead of the serial cable.

crashoverride
Posts: 5521
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 490 times
Contact:

Re: ESP8266 Thread

Post by crashoverride »

L67GS wrote:
Fri Dec 03, 2021 2:13 am
Initially I'd like to have a terminal direct line to just send commands while I learn, then try to use it as a serial bridge to the PC instead of the serial cable.
Not sure if this is what you are looking for:
https://linux.die.net/man/8/ser2net
These users thanked the author crashoverride for the post:
L67GS (Fri Dec 03, 2021 3:53 am)

L67GS
Posts: 707
Joined: Wed Apr 22, 2020 3:02 pm
languages_spoken: English, Jibberish, Pig Latin
ODROIDs: XU4, C1+,(3) C0's, and a whole big pile of accessories, VU7A Plus,, ect....
Location: Great Lakes Region, U.S.A
Has thanked: 212 times
Been thanked: 92 times
Contact:

Re: ESP8266 Thread

Post by L67GS »

crashoverride wrote:
Fri Dec 03, 2021 3:14 am
L67GS wrote:
Fri Dec 03, 2021 2:13 am
Initially I'd like to have a terminal direct line to just send commands while I learn, then try to use it as a serial bridge to the PC instead of the serial cable.
Not sure if this is what you are looking for:
https://linux.die.net/man/8/ser2net
Wow, that might do it. Thank You.

Post Reply

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 1 guest