ESP-Now support for ESP32 (and ESP8266)

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
User avatar
Lucje
Posts: 17
Joined: Sat May 14, 2022 4:08 pm
Location: Belgium

Re: ESP-Now support for ESP32 (and ESP8266)

Post by Lucje » Sat May 21, 2022 10:43 am

davef wrote:
Thu May 19, 2022 10:57 am
I would not run a program like that in boot.py.

Leave boot.py with nothing in it.
In main.py

Code: Select all

import my_program
in my_program.py put your wanted program.

Putting that code in boot.py and something goes wrong I am pretty certain that you will not be told what happened.
Tried it, doesn't make a difference.

User avatar
Lucje
Posts: 17
Joined: Sat May 14, 2022 4:08 pm
Location: Belgium

Re: ESP-Now support for ESP32 (and ESP8266)

Post by Lucje » Sat May 21, 2022 10:44 am

davef wrote:
Thu May 19, 2022 10:57 am
I would not run a program like that in boot.py.

Leave boot.py with nothing in it.
In main.py

Code: Select all

import my_program
in my_program.py put your wanted program.

Putting that code in boot.py and something goes wrong I am pretty certain that you will not be told what happened.
Tried it, doesn't make a difference.

User avatar
Lucje
Posts: 17
Joined: Sat May 14, 2022 4:08 pm
Location: Belgium

Re: ESP-Now support for ESP32 (and ESP8266)

Post by Lucje » Sat May 21, 2022 11:15 am

davef wrote:
Thu May 19, 2022 10:57 am
I would not run a program like that in boot.py.

Leave boot.py with nothing in it.
In main.py

Code: Select all

import my_program
in my_program.py put your wanted program.

Putting that code in boot.py and something goes wrong I am pretty certain that you will not be told what happened.
This boot works very good, it tells you which program is currently running and if there is an error which program is at fault.
Last edited by Lucje on Sat May 21, 2022 11:22 am, edited 1 time in total.

User avatar
Lucje
Posts: 17
Joined: Sat May 14, 2022 4:08 pm
Location: Belgium

Re: ESP-Now support for ESP32 (and ESP8266)

Post by Lucje » Sat May 21, 2022 11:19 am

In case you were wondering what I'm making:
It's a remote control car. Why Wifi, just because it can ;)

User avatar
Lucje
Posts: 17
Joined: Sat May 14, 2022 4:08 pm
Location: Belgium

Re: ESP-Now support for ESP32 (and ESP8266)

Post by Lucje » Sat May 21, 2022 1:09 pm

Apparently I only have to burn the firmware when I plug it in the computer.
It does al work fine as long I don't plug it in.
So guess it's not a big deal then :P

davef
Posts: 811
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: ESP-Now support for ESP32 (and ESP8266)

Post by davef » Sat May 21, 2022 8:03 pm

OK, on your boot.py. I made one of these recently:
https://randomnerdtutorials.com/esp32-c ... eb-server/
with my grandson.

So, you believe your firmware is being corrupted or deleted when you plug it into the PC?

User avatar
Lucje
Posts: 17
Joined: Sat May 14, 2022 4:08 pm
Location: Belgium

Re: ESP-Now support for ESP32 (and ESP8266)

Post by Lucje » Sun May 22, 2022 2:28 pm

davef wrote:
Sat May 21, 2022 8:03 pm
OK, on your boot.py. I made one of these recently:
https://randomnerdtutorials.com/esp32-c ... eb-server/
with my grandson.
Cool, that was my first system for this little car. But my teacher wished there was communication between 2 Esp32. It was allowed to do this communication wired, but then it was quite a boring rc-car concept. I don't like easy and boring, so I had to challenge myself :D
So, you believe your firmware is being corrupted or deleted when you plug it into the PC?
Yes indeed.
In fact, I've noticed that if I unplug it while it's still on and plug it back in later (without turning it off, rebooting, or resetting) there's no problem. If I turn it off, reboot or reset, I have to re-burn it.
Furthermore, EspNow works very well and I will definitely recommend it to others who are ready (not everyone in my class is equally clever ;) )

davef
Posts: 811
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: ESP-Now support for ESP32 (and ESP8266)

Post by davef » Sun May 22, 2022 8:47 pm

If you really want to get to the bottom of this problem ... is there a uPycraft forum? When I was looking around randomnerdtutorials I found a tutorial:
https://randomnerdtutorials.com/install ... tructions/
(be careful as it only works with 16.04 unless you compile yourself) with another link to:
https://randomnerdtutorials.com/flash-u ... 2-esp8266/
They seem to use the "boot" button in their process whereas on my system I use the EN button.

For a challenge grab a Linux PC install esptool and rshell and do it all from the command-line :)

User avatar
Lucje
Posts: 17
Joined: Sat May 14, 2022 4:08 pm
Location: Belgium

Re: ESP-Now support for ESP32 (and ESP8266)

Post by Lucje » Thu May 26, 2022 2:53 pm

davef wrote:
Sun May 22, 2022 8:47 pm
If you really want to get to the bottom of this problem ... is there a uPycraft forum? When I was looking around randomnerdtutorials I found a tutorial:
https://randomnerdtutorials.com/install ... tructions/
(be careful as it only works with 16.04 unless you compile yourself) with another link to:
https://randomnerdtutorials.com/flash-u ... 2-esp8266/
They seem to use the "boot" button in their process whereas on my system I use the EN button.

For a challenge grab a Linux PC install esptool and rshell and do it all from the command-line :)
I don't think it the problem is uPycraft, I tried it with Thonny and I had the same problem.
But as it's an unknown problem I guess the problem might be this kind of board.
I have ordered an other typ, but as it is from AliExpress it will never be delivered in time. I'll have to use the ones I have.
And if it's the only problem and the rest does work fine, it want be a problem for the project after all.

I thank you all for the assistance.

(PS, I'm a windows guy, I'm not used to use command line (jet ;) ).)

User avatar
Lucje
Posts: 17
Joined: Sat May 14, 2022 4:08 pm
Location: Belgium

Re: ESP-Now support for ESP32 (and ESP8266)

Post by Lucje » Thu May 26, 2022 3:01 pm

davef wrote:
Sun May 22, 2022 8:47 pm
They seem to use the "boot" button in their process whereas on my system I use the EN button.
I've never had to use one of those buttons...

I tried it and it doesn't make any difference.

Post Reply