ESP32 boards

Moderators: BertB, Voyager, grovkillen, Stuntteam, LisaM

Message
Author
LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

ESP32 boards

#1 Post by LisaM » 23 Dec 2017, 15:17

Firmware status: Beta
Firmware version: v0.2.1
Firmware revision:v60
Firmware installation instructions

Download esptool: https://github.com/espressif/esptool

When doing a FRESH install, ERASEyour ESP32 FILES area:

Code: Select all

LINUX: esptool.py --port /dev/ttyUSBx erase_flash

Code: Select all

WINDOWS: esptool.py --port COMx erase_flash
The FLASHBINARY file has this format: upyeasy_vXX_YYYYMMDD_test_esp32_ZZZZ.bin
The (latest) binary files can be downloaded here: https://github.com/letscontrolit/uPyEasy/releases

Load the new firmware into the ESP32, this will NOT impact your FILES area! Old uPyEasy files will not be touched.

Code: Select all

LINUX: esptool.py --port /dev/ttyUSBx write_flash --compress 0x1000 FLASHBINARY

Code: Select all

WINDOWS: esptool.py --port COMx write_flash --compress 0x1000 upyeasy-esp32.bin
PLEASE DO NOT SPECIFY OTHER PARAMETERS (like flash-size) AS STATED IN LATER POSTS!

In linux you can use the following command to connect to the ESP32: screen /dev/ttyUSBx 115200,cs8
In Windows just use putty to connect to the com port COMx at 115200 baud speed.
After flashing the firmware, the esptool will reboot your ESP32.
After reboot, uPyEasy will auto-start.
At absence of a configured ssid, uPyEasy will autoconnect to the strongest open-wifi AP.
If there's no open-wifi available, uPyEasy will stop and display the message (in REPL: Read, Eval, Print, Loop):

Code: Select all

Exiting: Network not available, set network values!
Run in REPL (python command line interface with the >>>) this command:

Code: Select all

upyeasy.setwifi('<your ssid>', '<your ssid password>','<your backup ssid, if any>', '<your backup ssid pw>',<your port>)
Only the ssid and ssid password are mandatory!

Then reboot using:

Code: Select all

import machine
machine.reset()
uPyEasy should be running on default port 80, unless you have choosen a different port number when setting the wifi parameters!, so connect using your browser using: http://<your upyeasy ip address>:80

If uPyEasy is connected to your open-wifi guest network, please remember that the assigned ip-address might not be accessible from your normal wifi AP. You'll need to forward an external port to uPyEasy internal ip-address + port.

If you get this 'error' report, it means that either boot.py or main.py has not automatically been created:

Code: Select all

OSError: [Errno 2] ENOENT
MicroPython v1.9.3-254-g41a9bdc-dirty on 2018-01-06; ESP32 module with ESP32
Type "help()" for more information.
Just type (the '>>>' is the repl prompt!):
>>> import upyeasy
>>> upyeasy.main()
Best is to add or create the boot.py file with these commands in it.
uPyEasy logfile might contain your SSID name, not password, if you encounter a bug and want to put the logfile in a post and care about the ssid name then replace that with xxxxx (or parts of it) and then post the logfile
(2MB firmware version now, due to reboot loops some are experiencing!)

AndrewJ
Normal user
Posts: 229
Joined: 14 Feb 2017, 12:38

Re: ESP32 boards

#2 Post by AndrewJ » 23 Dec 2017, 22:10

Hi Lisa,
About the OSError 128 I've been experiencing on my DOIT and Wemos LOLIN32 LITE boards...

I've been looking back through our messages, and I think we may have been looking at the wrong bit of code.

1. The last line of errors in my log is: File "uasyncio/__init__.py", line 241, in start_server

2. In a later message (#104), you wrote:
Line 214 is:
CODE: SELECT ALL
s2, client_addr = s.accept()

(note: the line number changed from 241 to 214)

I've looked on Github miocropython/micropython-lib at the code for __init__.py
Line 241 (the correct one) is in fact ..
s.bind(addr)

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: ESP32 boards

#3 Post by LisaM » 24 Dec 2017, 19:35

Hi Andrew,

I've updated all libraries and rebuild it, can you download the image from here and try again? If it still has the same error, can you set a different port using this: upyeasy.setwifi('<your ssid>', '<your ssid password>','', '',8000)
And then reboot to see if that's better.

AndrewJ
Normal user
Posts: 229
Joined: 14 Feb 2017, 12:38

Re: ESP32 boards

#4 Post by AndrewJ » 25 Dec 2017, 22:17

LisaM wrote:
24 Dec 2017, 19:35
I've updated all libraries and rebuild it, can you download the image from here and try again? If it still has the same error, can you set a different port using this: upyeasy.setwifi('<your ssid>', '<your ssid password>','', '',8000)
And then reboot to see if that's better.
Hi Lisa,
I just got back and gave this a try on my Wemos LOLIN32 LITE board, using the v52 upyeasy_esp32.zip in the first message of this topic.
Unfortunately the ESP32 is going into an endless reboot condition with the following messages repeated over and over:

Code: Select all

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3f400020,len:392168
ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3f400020,len:392168
I've tried a couple of times with the same result. Any ideas, please?

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: ESP32 boards

#5 Post by LisaM » 26 Dec 2017, 00:11

Hi Andrew,

I suspect it is this issue: https://github.com/micropython/micropyt ... /issues/49
Since you're already using DIO, i've attached a special 2MB version of uPyEasy. Give that one a try.
The Wemos LOLIN32 LITE has a maximum baudrate of 256000, you might want to try that to:
esptool.py --port /dev/ttyUSBx write_flash --baud 256000 --compress 0x1000 firmware.bin
If not:
- Did you erase the ESP32?
- Does it happen with both ESP32's?
- Is the power supply big enough (the esp32 itself is using at least 500ma!)

Cheers,

Lisa

Ps, this is my esp32 boot:
esp32 boot.png
esp32 boot.png (456.53 KiB) Viewed 9634 times

AndrewJ
Normal user
Posts: 229
Joined: 14 Feb 2017, 12:38

Re: ESP32 boards

#6 Post by AndrewJ » 27 Dec 2017, 17:14

Hi Lisa,
Just got back onto this. Thanks for sending the 2MB version to try.

Initially I'm working with the LOLIIN32 LITE board as it has the revision 1 chip, and just to keep it relatively simple and straight forward. I haven't yet tried this version on my other board, the DOIT devkit v1.

First off, after erasing, I tried
esptool.py --port /dev/ttyUSBx write_flash --baud 256000 --compress 0x1000 firmware.bin
This wouldn't run for me. Tried moving the --baud 256000 after /dev/ttyUSBx but got fatal error.

Read your comments about power, and reading https://github.com/micropython/micropyt ... issues/109 I added a 4u7 capacitor across 3.3v and GND. Erased again, then flashed the 2MB file at 115200 baud which seemed to go ok. The startup log as follows:

Code: Select all

pi@homeassistant:~/upyeasy_esp32/esptool-master $ screen /dev/ttyUSB0 115200,cs8I (1808) wifi: Init data frame dynamic rx buffer num: 64
I (1808) wifi: Init management frame dynamic rx buffer num: 64
I (1808) wifi: wifi driver task: 3ffe3104, prio:23, stack:4096
I (1818) wifi: Init static rx buffer num: 10
I (1818) wifi: Init dynamic rx buffer num: 0
I (1828) wifi: Init rx ampdu len mblock:7
I (1828) wifi: Init lldesc rx ampdu entry mblock:4
I (1828) wifi: wifi power manager task: 0x3ffe98fc prio: 21 stack: 2560
I (1868) phy: phy_version: 362.0, 61e8d92, Sep  8 2017, 18:48:11, 0, 0
I (1868) wifi: mode : null
I (1868) wifi: mode : sta (30:ae:a4:39:16:e4)
I (1878) wifi: STA_START
2000-01-01T00:00:01.005 [debug] uPyEasy: Hal: esp32, ssid empty
I (4308) network: event 1
2000-01-01T00:00:04.005 [debug] uPyEasy: Hal: esp32, Scan: Ssid found: TALKTALK65AFF2 Strength: -60 dBm Security: 4
2000-01-01T00:00:04.005 [debug] uPyEasy: Protocols: Load
2000-01-01T00:00:04.005 [debug] uPyEasy: Protocols: Init protocol records
2000-01-01T00:00:04.005 [debug] uPyEasy: Protocols: Load protocol domoticz_mqtt
2000-01-01T00:00:04.005 [debug] uPyEasy: Protocols: Create protocol Record: domoticz_mqtt
2000-01-01T00:00:05.005 [debug] uPyEasy: Protocols: Load protocol domoticz_http
2000-01-01T00:00:05.005 [debug] uPyEasy: Protocols: Create protocol Record: domoticz_http
2000-01-01T00:00:05.005 [debug] uPyEasy: Protocols: Init protocol records, run async loop
2000-01-01T00:00:05.005 [debug] uPyEasy: Plugins: Load
2000-01-01T00:00:05.005 [debug] uPyEasy: Plugins: init plugin records
2000-01-01T00:00:05.005 [debug] uPyEasy: Plugins: Load frozen plugin switch
2000-01-01T00:00:05.005 [debug] uPyEasy: Plugin: switch contruction
2000-01-01T00:00:05.005 [debug] uPyEasy: Plugins: Create frozen plugin Record: switch
2000-01-01T00:00:06.005 [debug] uPyEasy: Plugins: Load frozen plugin ds18
2000-01-01T00:00:06.005 [debug] uPyEasy: Plugin: ds18 contruction
2000-01-01T00:00:06.005 [debug] uPyEasy: Plugins: Create frozen plugin Record: ds18
2000-01-01T00:00:06.005 [debug] uPyEasy: Plugins: Init plugin records, run async loop
2000-01-01T00:00:06.005 [debug] uPyEasy: Utils: Sys hostname
2000-01-01T00:00:06.005 [debug] uPyEasy: Utils: uPyEasy Name
Set syslog hostname 0.0.0.0
reloaded sink syslog
2000-01-01T00:00:06.005 [debug] uPyEasy-uPyEasy: Hal: Entering SetTime
2000-01-01T00:00:06.005 [debug] uPyEasy-uPyEasy: Hal: Entering GetNtpTime
2000-01-01T00:00:06.005 [debug] uPyEasy-uPyEasy: Hal: network Table
2000-01-01T00:00:06.005 [debug] uPyEasy-uPyEasy: Hal: Using NTP Hostname: pool.ntp.org
2000-01-01T00:00:06.005 [debug] uPyEasy-uPyEasy: Hal: TimeZome offset: 60
Traceback (most recent call last):
  File "boot.py", line 3, in <module>
  File "upyeasy/__init__.py", line 40, in main
  File "upyeasy/init.py", line 223, in init
  File "upyeasy/hal.py", line 318, in settime
  File "upyeasy/hal.py", line 256, in getntptime
  File "upyeasy/hal.py", line 248, in getntptime
IndexError: list index out of range
OSError: [Errno 2] ENOENT
MicroPython v1.9.3-194-ga661b85-dirty on 2017-12-26; ESP32 module with ESP32
Type "help()" for more information.
>>>
So.. the good news is that OSError 128 has gone :D :D and it does seem to have successfully done a lot of the startup steps....
but.. instead I now have OSError [Errno 2] ENOENT. :(

Looking at this link: https://github.com/micropython/micropyt ... /issues/90 it appears others have had similar, and that it may not actually be harmful (?) and/or main.py may be missing. On the other hand, it looks from the Traceback that there is a problem with getntptime/list index out of range.

What's your view on this?

Regards,
AndrewJ

AndrewJ
Normal user
Posts: 229
Joined: 14 Feb 2017, 12:38

Re: ESP32 boards

#7 Post by AndrewJ » 27 Dec 2017, 17:45

An update on the last post...
I decided to try the solution to the "missing main.py" given in the Github issue 90, and created a file through the REPL. Rebooted (by pressing the RESET button on the ESP32 board) and it now starts without the ENOENT error, (and it says Hello!) but it still has...

Code: Select all

2000-01-01T00:00:06.005 [debug] uPyEasy-uPyEasy: Hal: Entering SetTime
2000-01-01T00:00:06.005 [debug] uPyEasy-uPyEasy: Hal: Entering GetNtpTime
2000-01-01T00:00:06.005 [debug] uPyEasy-uPyEasy: Hal: network Table
2000-01-01T00:00:06.005 [debug] uPyEasy-uPyEasy: Hal: Using NTP Hostname: pool.ntp.org
2000-01-01T00:00:06.005 [debug] uPyEasy-uPyEasy: Hal: TimeZome offset: 60
Traceback (most recent call last):
  File "boot.py", line 3, in <module>
  File "upyeasy/__init__.py", line 40, in main
  File "upyeasy/init.py", line 223, in init
  File "upyeasy/hal.py", line 318, in settime
  File "upyeasy/hal.py", line 256, in getntptime
  File "upyeasy/hal.py", line 248, in getntptime
IndexError: list index out of range
main.py: Hello
MicroPython v1.9.3-194-ga661b85-dirty on 2017-12-26; ESP32 module with ESP32
Type "help()" for more information.
... so to me, it looks like a problem with upyeasy/hal.py line 248, in getntptime :?:

We're making progress, I think... ;)
AndrewJ

AndrewJ
Normal user
Posts: 229
Joined: 14 Feb 2017, 12:38

Re: ESP32 boards

#8 Post by AndrewJ » 27 Dec 2017, 18:37

Hmmm, I realised that for the last few tests today my wifi has been back to password protected. Presumably it still needs to be open, for the ESP32 to connect?

Anyway, I made it open again and rebooted the LOLIN32 LITE (still with the 2MB firmware). This time it got several steps further in the log, to the point where it has obtained an IP address, and is accessing plugins. Then it gets an error -- oh no, it's OSError 128 again!! :o

This is the log....

Code: Select all

2000-01-01T00:00:07.005 [debug] uPyEasy: Protocols: Load protocol domoticz_http
2000-01-01T00:00:07.005 [debug] uPyEasy: Protocols: Create protocol Record: domoticz_http
2000-01-01T00:00:07.005 [debug] uPyEasy: Protocols: Init protocol records, run async loop
2000-01-01T00:00:07.005 [debug] uPyEasy: Plugins: Load
2000-01-01T00:00:07.005 [debug] uPyEasy: Plugins: init plugin records
2000-01-01T00:00:08.005 [debug] uPyEasy: Plugins: Load frozen plugin switch
2000-01-01T00:00:08.005 [debug] uPyEasy: Plugin: switch contruction
2000-01-01T00:00:08.005 [debug] uPyEasy: Plugins: Create frozen plugin Record: switch
2000-01-01T00:00:08.005 [debug] uPyEasy: Plugins: Load frozen plugin ds18
2000-01-01T00:00:08.005 [debug] uPyEasy: Plugin: ds18 contruction
2000-01-01T00:00:08.005 [debug] uPyEasy: Plugins: Create frozen plugin Record: ds18
I (8898) wifi: pm start, type:0

2000-01-01T00:00:08.005 [debug] uPyEasy: Plugins: Init plugin records, run async loop
2000-01-01T00:00:08.005 [debug] uPyEasy: Utils: Sys hostname
2000-01-01T00:00:09.005 [debug] uPyEasy: Utils: uPyEasy Name
Set syslog hostname 0.0.0.0
reloaded sink syslog
2000-01-01T00:00:09.005 [debug] uPyEasy-uPyEasy: Hal: Entering SetTime
2000-01-01T00:00:09.005 [debug] uPyEasy-uPyEasy: Hal: Entering GetNtpTime
2000-01-01T00:00:09.005 [debug] uPyEasy-uPyEasy: Hal: network Table
2000-01-01T00:00:09.005 [debug] uPyEasy-uPyEasy: Hal: Using NTP Hostname: pool.ntp.org
2000-01-01T00:00:09.005 [debug] uPyEasy-uPyEasy: Hal: TimeZome offset: 60
2000-01-01T00:00:09.005 [debug] uPyEasy-uPyEasy: Hal: Received UTC NTP Time: 567709223
2000-01-01T00:00:09.005 [debug] uPyEasy-uPyEasy: Hal: Timezone corrected NTP Time: 567712823
2000-01-01T00:00:09.005 [debug] uPyEasy-uPyEasy: Hal: DST corrected NTP Time: 567712823
2000-01-01T00:00:09.005 [debug] uPyEasy-uPyEasy: Hal: Received NTP Time: 567712823
2000-01-01T00:00:09.005 [debug] uPyEasy-uPyEasy: Hal: StartTime: 567712823
2000-01-01T00:00:09.005 [debug] uPyEasy-uPyEasy: Hal: SetTime: NO RTC!
2000-01-01T00:00:09.005 [debug] uPyEasy-uPyEasy: Main: Pre-loading home page
2000-01-01T00:00:10.005 [debug] uPyEasy-uPyEasy: Hal: get_ip_address esp32, ip: 192.168.1.18
2000-01-01T00:00:10.005 [debug] uPyEasy-uPyEasy: Main: uPyEasy Main Async Loop
* Running on http://192.168.1.18:80/
2000-01-01T00:00:10.005 [debug] uPyEasy-uPyEasy: Protocols: Async processing protocols
2000-01-01T00:00:10.005 [debug] uPyEasy-uPyEasy: Plugins: Async processing plugins
Traceback (most recent call last):
  File "boot.py", line 3, in <module>
  File "upyeasy/__init__.py", line 56, in main
  File "picoweb/__init__.py", line 275, in run
  File "uasyncio/core.py", line 138, in run_forever
  File "uasyncio/core.py", line 97, in run_forever
  File "uasyncio/__init__.py", line 249, in start_server
OSError: 128
main.py: Hello
MicroPython v1.9.3-194-ga661b85-dirty on 2017-12-26; ESP32 module with ESP32
Type "help()" for more information.
>>>
The line number is different this time around - line 249 of uasyncio/__init__.py
What is this line trying to do? I'm still unsure what OSError 128 means, even after some googling.

I hope you had an enjoyable Christmas.
Regards
AndrewJ

AndrewJ
Normal user
Posts: 229
Joined: 14 Feb 2017, 12:38

Re: ESP32 boards

#9 Post by AndrewJ » 27 Dec 2017, 19:06

I remembered that (several messages earlier) you said that if I still got OSError 128, I could try
[/code]upyeasy.setwifi('<your ssid>', '<your ssid password>','', '',8000)[/code]

So I put the wifi back to password-protected, then did the above (at the REPL >>>), then rebooted on the RESET button. It got the furthest I have seen so far! But still ended with error 128!! Arggh!

Here's the full log after restart...

Code: Select all

pi@homeassistant:~/upyeasy_esp32/esptool-master $ screen /dev/ttyUSB0 115200,cs82000-01-01T00:00:05.005 [debug] uPyEasy: Protocols: Load
2000-01-01T00:00:05.005 [debug] uPyEasy: Protocols: Init protocol records
2000-01-01T00:00:05.005 [debug] uPyEasy: Protocols: Load protocol domoticz_mqtt
2000-01-01T00:00:05.005 [debug] uPyEasy: Protocols: Create protocol Record: domoticz_mqtt
2000-01-01T00:00:05.005 [debug] uPyEasy: Protocols: Load protocol domoticz_http
2000-01-01T00:00:05.005 [debug] uPyEasy: Protocols: Create protocol Record: domoticz_http
2000-01-01T00:00:06.005 [debug] uPyEasy: Protocols: Init protocol records, run async loop
2000-01-01T00:00:06.005 [debug] uPyEasy: Plugins: Load
2000-01-01T00:00:06.005 [debug] uPyEasy: Plugins: init plugin records
I (6788) wifi: pm start, type:0

2000-01-01T00:00:06.005 [debug] uPyEasy: Plugins: Load frozen plugin switch
2000-01-01T00:00:06.005 [debug] uPyEasy: Plugin: switch contruction
2000-01-01T00:00:06.005 [debug] uPyEasy: Plugins: Create frozen plugin Record: switch
2000-01-01T00:00:07.005 [debug] uPyEasy: Plugins: Load frozen plugin ds18
2000-01-01T00:00:07.005 [debug] uPyEasy: Plugin: ds18 contruction
2000-01-01T00:00:07.005 [debug] uPyEasy: Plugins: Create frozen plugin Record: ds18
2000-01-01T00:00:07.005 [debug] uPyEasy: Plugins: Init plugin records, run async loop
2000-01-01T00:00:07.005 [debug] uPyEasy: Utils: Sys hostname
2000-01-01T00:00:07.005 [debug] uPyEasy: Utils: uPyEasy Name
Set syslog hostname 0.0.0.0
reloaded sink syslog
2000-01-01T00:00:07.005 [debug] uPyEasy-uPyEasy: Hal: Entering SetTime
2000-01-01T00:00:07.005 [debug] uPyEasy-uPyEasy: Hal: Entering GetNtpTime
2000-01-01T00:00:07.005 [debug] uPyEasy-uPyEasy: Hal: network Table
2000-01-01T00:00:07.005 [debug] uPyEasy-uPyEasy: Hal: Using NTP Hostname: pool.ntp.org
2000-01-01T00:00:07.005 [debug] uPyEasy-uPyEasy: Hal: TimeZome offset: 60
2000-01-01T00:00:09.005 [debug] uPyEasy-uPyEasy: Hal: NTP Time OSError exception: OSError(110,)
2000-01-01T00:00:09.005 [debug] uPyEasy-uPyEasy: Hal: Received NTP Time: n.a.
2000-01-01T00:00:09.005 [debug] uPyEasy-uPyEasy: Main: Pre-loading home page
2000-01-01T00:00:09.005 [debug] uPyEasy-uPyEasy: Hal: get_ip_address esp32, ip: 192.168.1.18
2000-01-01T00:00:09.005 [debug] uPyEasy-uPyEasy: Main: uPyEasy Main Async Loop
* Running on http://192.168.1.18:80/
2000-01-01T00:00:09.005 [debug] uPyEasy-uPyEasy: Protocols: Async processing protocols
2000-01-01T00:00:09.005 [debug] uPyEasy-uPyEasy: Plugins: Async processing plugins
Traceback (most recent call last):
  File "boot.py", line 3, in <module>
  File "upyeasy/__init__.py", line 56, in main
  File "picoweb/__init__.py", line 275, in run
  File "uasyncio/core.py", line 138, in run_forever
  File "uasyncio/core.py", line 97, in run_forever
  File "uasyncio/__init__.py", line 249, in start_server
OSError: 128
main.py: Hello
MicroPython v1.9.3-194-ga661b85-dirty on 2017-12-26; ESP32 module with ESP32
Type "help()" for more information.
Then, while I was typing this and the ESP is still powered on, it produced this...

Code: Select all

>>> I (222298) wifi: n:11 0, o:11 2, ap:255 255, sta:11 0, prof:1
Hope this helps! ;)

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: ESP32 boards

#10 Post by LisaM » 27 Dec 2017, 23:20

Hi Andrew,

The last line is the ESP32 wifi reporting, it's doing that from time to time.
I don't know what OSError 128 is, i've asked the same question to the dev team: https://github.com/micropython/micropython/issues/3513
No answer yet...

Let's do a long shot, i have disabled the settime function because only there are sockets used. Maybe the GC (garbage collector) is still closing the socket the moment it's being used in line 249 ( which is still 's2, client_addr = s.accept()' since the library has been updated). So not using any socket maybe solves your problem. Attached the custom firmware.

Cheers,

Lisa

Ps. I2C is also working in this version.

AndrewJ
Normal user
Posts: 229
Joined: 14 Feb 2017, 12:38

Re: ESP32 boards

#11 Post by AndrewJ » 28 Dec 2017, 09:52

Hi Lisa, thanks for the quick reply. I'll give this a try later today.
Good news about I2C.

AndrewJ
Normal user
Posts: 229
Joined: 14 Feb 2017, 12:38

Re: ESP32 boards

#12 Post by AndrewJ » 28 Dec 2017, 13:37

LisaM wrote:
27 Dec 2017, 23:20
Hi Andrew,

The last line is the ESP32 wifi reporting, it's doing that from time to time.
I don't know what OSError 128 is, i've asked the same question to the dev team: https://github.com/micropython/micropython/issues/3513
No answer yet...

Let's do a long shot, i have disabled the settime function because only there are sockets used. Maybe the GC (garbage collector) is still closing the socket the moment it's being used in line 249 ( which is still 's2, client_addr = s.accept()' since the library has been updated). So not using any socket maybe solves your problem. Attached the custom firmware.

Cheers,

Lisa

Ps. I2C is also working in this version.
I'm afraid that still has the OSError 128 at line 249 of usasyncio/__init__.py in start_server. This occurred a few seconds (5..10? sec) after the initial run of messages.
This is on the LOLIN32 LITE, with my wifi open.

Here is the full log...

Code: Select all

login as: pi
pi@192.168.1.12's password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed Dec 27 20:34:48 2017 from 192.168.1.4
pi@homeassistant:~ $
pi@homeassistant:~ $
pi@homeassistant:~ $ cd upyeasy_esp32
pi@homeassistant:~/upyeasy_esp32 $ ls
esptool-master  esptool-master.zip  webserver.py
pi@homeassistant:~/upyeasy_esp32 $ cd esptool-master
pi@homeassistant:~/upyeasy_esp32/esptool-master $ ls
CONTRIBUTING.md                          firmware201217.bin   pyaes
ecdsa                                    firmware261217.bin   README.md
esp32-20171223-v1.9.3-216-gb8068895.bin  firmware.bin         setup.cfg
espefuse.py                              firmware.bin.alpha1  setup.py
espsecure.py                             flasher_stub         test
esptool.py                               LICENSE              upyeasy-esp32.bin
firmware191217.bin                       MANIFEST.in
pi@homeassistant:~/upyeasy_esp32/esptool-master $ python esptool.py --port /dev/ttyUSB0 erase_flash
esptool.py v2.2-dev
Traceback (most recent call last):
  File "esptool.py", line 2541, in <module>
    _main()
  File "esptool.py", line 2534, in _main
    main()
  File "esptool.py", line 2257, in main
    esp = ESPLoader.detect_chip(args.port, initial_baud, args.before)
  File "esptool.py", line 204, in detect_chip
    detect_port = ESPLoader(port, baud)
  File "esptool.py", line 178, in __init__
    self._port = serial.serial_for_url(port)
  File "/usr/local/lib/python2.7/dist-packages/serial/__init__.py", line 88, in serial_for_url
    instance.open()
  File "/usr/local/lib/python2.7/dist-packages/serial/serialposix.py", line 286, in open
    self._update_dtr_state()
  File "/usr/local/lib/python2.7/dist-packages/serial/serialposix.py", line 634, in _update_dtr_state
    fcntl.ioctl(self.fd, TIOCMBIS, TIOCM_DTR_str)
IOError: [Errno 71] Protocol error
pi@homeassistant:~/upyeasy_esp32/esptool-master $
pi@homeassistant:~/upyeasy_esp32/esptool-master $
pi@homeassistant:~/upyeasy_esp32/esptool-master $
pi@homeassistant:~/upyeasy_esp32/esptool-master $ python esptool.py --port /dev/ttyUSB0 erase_flash
esptool.py v2.2-dev
Connecting....
Detecting chip type... ESP32
Chip is ESP32D0WDQ6 (revision 1)
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...
Chip erase completed successfully in 6.4s
Hard resetting...
pi@homeassistant:~/upyeasy_esp32/esptool-master $
pi@homeassistant:~/upyeasy_esp32/esptool-master $
pi@homeassistant:~/upyeasy_esp32/esptool-master $
pi@homeassistant:~/upyeasy_esp32/esptool-master $
pi@homeassistant:~/upyeasy_esp32/esptool-master $ python esptool.py --chip esp32 --port /dev/ttyUSB0 write_flash -z 0x1000 firmware271217.bin
esptool.py v2.2-dev
Connecting....
Chip is ESP32D0WDQ6 (revision 1)
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Flash params set to 0x0220
Compressed 1164800 bytes to 682220...
Wrote 1164800 bytes (682220 compressed) at 0x00001000 in 61.6 seconds (effective 151.2 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting...
pi@homeassistant:~/upyeasy_esp32/esptool-master $ screen /dev/ttyUSB0 115200,cs82000-01-01 00:00:11 [debug] uPyEasy: Plugins: Load
2000-01-01 00:00:11 [debug] uPyEasy: Plugins: init plugin records
2000-01-01 00:00:11 [debug] uPyEasy: Plugins: Load frozen plugin switch
2000-01-01 00:00:11 [debug] uPyEasy: Plugin: switch contruction
2000-01-01 00:00:11 [debug] uPyEasy: Plugins: Create frozen plugin Record: switch
2000-01-01 00:00:11 [debug] uPyEasy: Plugins: Load frozen plugin ds18
2000-01-01 00:00:11 [debug] uPyEasy: Plugin: ds18 contruction
2000-01-01 00:00:11 [debug] uPyEasy: Plugins: Create frozen plugin Record: ds18
2000-01-01 00:00:12 [debug] uPyEasy: Plugins: Init plugin records, run async loop
2000-01-01 00:00:12 [debug] uPyEasy: Utils: Sys hostname
2000-01-01 00:00:12 [debug] uPyEasy: Utils: uPyEasy Name
Set syslog hostname 0.0.0.0
reloaded sink syslog
2000-01-01 00:00:12 [debug] uPyEasy-uPyEasy: Hal: Entering SetTime
2000-01-01 00:00:12 [debug] uPyEasy-uPyEasy: Hal: Entering GetNtpTime
2000-01-01 00:00:12 [debug] uPyEasy-uPyEasy: Hal: network Table
2000-01-01 00:00:12 [debug] uPyEasy-uPyEasy: Hal: Using NTP Hostname: pool.ntp.org
2000-01-01 00:00:12 [debug] uPyEasy-uPyEasy: Hal: TimeZome offset: 60
I (13289) wifi: pm start, type:0

2000-01-01 00:00:13 [debug] uPyEasy-uPyEasy: Hal: NTP Time OSError exception: OSError(110,)
2000-01-01 00:00:13 [debug] uPyEasy-uPyEasy: Hal: Received NTP Time: n.a.
2000-01-01 00:00:13 [debug] uPyEasy-uPyEasy: Main: Pre-loading home page
2000-01-01 00:00:14 [debug] uPyEasy-uPyEasy: Hal: get_ip_address esp32, ip: 192.168.1.18
2000-01-01 00:00:14 [debug] uPyEasy-uPyEasy: Main: uPyEasy Main Async Loop
* Running on http://192.168.1.18:80/
2000-01-01 00:00:14 [debug] uPyEasy-uPyEasy: Protocols: Async processing protocols
2000-01-01 00:00:14 [debug] uPyEasy-uPyEasy: Plugins: Async processing plugins
Traceback (most recent call last):
  File "boot.py", line 3, in <module>
  File "upyeasy/__init__.py", line 56, in main
  File "picoweb/__init__.py", line 275, in run
  File "uasyncio/core.py", line 138, in run_forever
  File "uasyncio/core.py", line 97, in run_forever
  File "uasyncio/__init__.py", line 249, in start_server
OSError: 128
OSError: [Errno 2] ENOENT
MicroPython v1.9.3-194-ga661b85-dirty on 2017-12-27; ESP32 module with ESP32
Type "help()" for more information.
>>>
I notice that there is an error early on: IOError: [Errno 71] Protocol error

and another error reported a few lines before the end:

Code: Select all

2000-01-01 00:00:13 [debug] uPyEasy-uPyEasy: Hal: NTP Time OSError exception: OSError(110,)
but despite these, it successfully got an IP address (also shows in my router).

I hope this gives you something to go on. If you'd like me to try something else, let me know.

Cheers
AndrewJ

kociubin
Normal user
Posts: 11
Joined: 09 Nov 2017, 02:48

Re: ESP32 boards

#13 Post by kociubin » 28 Dec 2017, 22:34

This is great! I'm able to run your special 2MB firmware on a doit.am v1 devkit ($7 on aliexpress).

So far, it's very encouraging. Please keep it up and let me know if I can help in any way.

BTW, is MQTT supposed to work? I tried pointing it at my MQTT server but there is no activity.

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: ESP32 boards

#14 Post by LisaM » 28 Dec 2017, 22:49

kociubin wrote:
28 Dec 2017, 22:34
This is great! I'm able to run your special 2MB firmware on a doit.am v1 devkit ($7 on aliexpress).

So far, it's very encouraging. Please keep it up and let me know if I can help in any way.

BTW, is MQTT supposed to work? I tried pointing it at my MQTT server but there is no activity.
Is the normal 4MB firmware from the first post also working?

MQTT should be working, at least Domoticz MQTT, are the settings correct (should the same as in ESPEasy). Is Domoticz HTTP working? Which plugin are you using?

kociubin
Normal user
Posts: 11
Joined: 09 Nov 2017, 02:48

Re: ESP32 boards

#15 Post by kociubin » 29 Dec 2017, 00:01

LisaM wrote:
28 Dec 2017, 22:49
Is the normal 4MB firmware from the first post also working?

MQTT should be working, at least Domoticz MQTT, are the settings correct (should the same as in ESPEasy). Is Domoticz HTTP working? Which plugin are you using?
No. 4MB firmware is not working. I was getting bootloops like in post #4.

For MQTT I'm using the Domoticz MQTT plugin. I don't really have a Domoticz server--I have a standard mosquitto MQTT server with a username and password. I saw the Domoticz MQTT plugin work before with ESP8266 so I figured I'd give it a try here. I'm seeing messages like this:

Code: Select all

[debug] uPyEasy: Protocols: GetQueue controller myhomeserver.something.com-Domoticz MQTT-1

CHK_BLN
Normal user
Posts: 24
Joined: 19 Nov 2015, 22:14

Re: ESP32 boards

#16 Post by CHK_BLN » 29 Dec 2017, 00:08

Hi Lisa,

with me the firmware (upyeasy-esp32.zip) from the first post does not work either. (Hardware is a doit.am v1 devkit).
The adapted 2 MB version works.
When I set up an MQTT server on the controllers side and press SUBMIT, I get the message "Error: Connection interrupted" in the browser. If I call the controllers page again, the changes have been saved.
I could not test the MQTT function yet.

Best regards
Christof

kociubin
Normal user
Posts: 11
Joined: 09 Nov 2017, 02:48

Re: ESP32 boards

#17 Post by kociubin » 29 Dec 2017, 00:14

Also, I tried testing the switch plugin with no success (still running the 2MB firmware). I tried GPIO12 and GPIO4 and they're never read. Nothing is output in the logs after I pull them to GND. I made sure I changed the delay to 10 seconds. I also tried setting them up as inputs on the Hardware tab but that doesn't help either.

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: ESP32 boards

#18 Post by LisaM » 29 Dec 2017, 00:35

kociubin wrote:
29 Dec 2017, 00:01
No. 4MB firmware is not working. I was getting bootloops like in post #4.

For MQTT I'm using the Domoticz MQTT plugin. I don't really have a Domoticz server--I have a standard mosquitto MQTT server with a username and password. I saw the Domoticz MQTT plugin work before with ESP8266 so I figured I'd give it a try here. I'm seeing messages like this:

Code: Select all

[debug] uPyEasy: Protocols: GetQueue controller myhomeserver.something.com-Domoticz MQTT-1
Ok, i'll switch to 2MB standard firmware then since more people have this issue.

The controller (using protocol mqtt) isn't sending anything unless a device has put a message in the controller queue, so you'll need to add a (switch?) device using the (mqtt) controller.

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: ESP32 boards

#19 Post by LisaM » 29 Dec 2017, 00:37

kociubin wrote:
29 Dec 2017, 00:14
Also, I tried testing the switch plugin with no success (still running the 2MB firmware). I tried GPIO12 and GPIO4 and they're never read. Nothing is output in the logs after I pull them to GND. I made sure I changed the delay to 10 seconds. I also tried setting them up as inputs on the Hardware tab but that doesn't help either.
I'll test GPIO12/4 also, i'll let you know if i can reproduce it.

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: ESP32 boards

#20 Post by LisaM » 29 Dec 2017, 00:50

AndrewJ wrote:
28 Dec 2017, 13:37
I hope this gives you something to go on. If you'd like me to try something else, let me know.
The only difference from your setup compared to other is the Wifi AP, which one (hw) are you using? Are you using WPA2 or Open? Is the webbrowser client in the same network?
The accept gives the error, meaning the accept errors out getting a connection/address pair. Are you using vpn or any other different way of connecting to the ESP32? (socket accept: https://docs.micropython.org/en/latest/ ... ocket.html)
And it didn't happen when importing wstest (import wstest)? I've attached the source code, but it's also part of modules in your micropython firmware.

User avatar
budman1758
Normal user
Posts: 234
Joined: 15 Apr 2017, 05:13
Location: Riverside CA USA

Re: ESP32 boards

#21 Post by budman1758 » 29 Dec 2017, 09:12

I hate to be "that guy" :roll: but would you happen to have a windows flashing howto laying around anywhere? I'm not having much luck here.... :mrgreen:
"The glass is twice as big as it needs to be".

AndrewJ
Normal user
Posts: 229
Joined: 14 Feb 2017, 12:38

Re: ESP32 boards

#22 Post by AndrewJ » 29 Dec 2017, 10:10

LisaM wrote:
29 Dec 2017, 00:50
AndrewJ wrote:
28 Dec 2017, 13:37
I hope this gives you something to go on. If you'd like me to try something else, let me know.
The only difference from your setup compared to other is the Wifi AP, which one (hw) are you using? Are you using WPA2 or Open? Is the webbrowser client in the same network?
The accept gives the error, meaning the accept errors out getting a connection/address pair. Are you using vpn or any other different way of connecting to the ESP32? (socket accept: https://docs.micropython.org/en/latest/ ... ocket.html)
And it didn't happen when importing wstest (import wstest)? I've attached the source code, but it's also part of modules in your micropython firmware.
Hi Lisa,
My recent tests have all been with the Wemos LOLIN32 LITE board, not the DOIT. (at the moment I've been leaving the DOIT just to keep things more simple) so that is one difference from the recent successes for @CHK_BLN and @kociubin if I understand correctly. (am I right in thinking that these are both with the DOIT devkit 1?)

My Wifi AP is a Huawei HG635. For the tests with ESP32 I've been switching off the security in the router interface to allow an Open connection by the ESP32. There's no VPN, The client computer where I'm trying to see the ESP32's web interface is on the same network, connected to the router by ethernet.

The router is working ok for the rest of my home network, including 3 ESP8266 Nodemcu's. But I do sometimes get the feeling that it gets overloaded, so one possibility is that the router responds too slowly for the ESP32 and it times out or something. However, yesterday it did establish an IP address before the error appeared, so maybe its some higher-level part of the connection which failed.

When I used wstest (which is a number of days ago now) it didn't give the OSError 128. You seem to be saying that wstest is included in the more recent firmware, e.g. the 2MB version? If so, I will try importing it again and see what happens.

Another test I can run is to use an old spare wireless router, with open wifi, and see if I can connect to it.

I'll let you know how it goes. It's really encouraging that others are getting a successful connection! :)

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: ESP32 boards

#23 Post by LisaM » 29 Dec 2017, 14:22

Hi Andrew,

I've upgraded the wstest program to upyeasy_wifi_test program, it's source code is attached. Also the firmware in post 1 is upgraded. Can you flash that version and after the error run: import upyeasy_wifi_test

Cheers,

Lisa

AndrewJ
Normal user
Posts: 229
Joined: 14 Feb 2017, 12:38

Re: ESP32 boards

#24 Post by AndrewJ » 29 Dec 2017, 15:07

OK, thanks for that. I'll try it later and let you know how it goes.
Cheers
Andrew

AndrewJ
Normal user
Posts: 229
Joined: 14 Feb 2017, 12:38

Re: ESP32 boards

#25 Post by AndrewJ » 29 Dec 2017, 15:56

LisaM wrote:
29 Dec 2017, 14:22
Hi Andrew,

I've upgraded the wstest program to upyeasy_wifi_test program, it's source code is attached. Also the firmware in post 1 is upgraded. Can you flash that version and after the error run: import upyeasy_wifi_test

Cheers,

Lisa
Hi Lisa,
I did that and again got the OSError 128 as before.
I then did import upyeasy_wifi_test
I got this...

Code: Select all

>>> import upyeasy_wifi_test
Starting uPyEasy Webserver test...
I (57239) network: event 1
SSID:  TALKTALK65AFF2  Channel:  11 Strength:  -28  Security type:  0
Trying to connect to AP:  TALKTALK65AFF2
Bind address info: [(2, 1, 0, '0.0.0.0', ('0.0.0.0', 80))]
Listening, connect your browser to http://<this_host>:80/
This looks like it made the wifi connection to my AP (confirmed through the router interface, address is 192.168.1.18)
What I don't understand is the Bind address info, why is it showing '0.0.0.0' ?
I tried to connect my browser to 192.168.1.18:80 but after quite a long time it timed out with

Code: Select all

This site can’t be reached
192.168.1.18 took too long to respond.
I'm not sure what I should put for <this_host> in the Listening, etc line? Am I right by putting the IP address I see in my router?
Cheers
Andrew

kociubin
Normal user
Posts: 11
Joined: 09 Nov 2017, 02:48

Re: ESP32 boards

#26 Post by kociubin » 29 Dec 2017, 16:13

LisaM wrote:
29 Dec 2017, 14:22
Hi Andrew,

I've upgraded the wstest program to upyeasy_wifi_test program, it's source code is attached. Also the firmware in post 1 is upgraded. Can you flash that version and after the error run: import upyeasy_wifi_test

Cheers,

Lisa
Working: The 12/29 version boots fine. It connects to WiFi. NTP works. I'm able to make configuration changes using the webUI.
Not Working: Not able to read any of the GPIOs using the switch plugin.

Let me know if I should be doing something special to get the switch plugin working.

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: ESP32 boards

#27 Post by LisaM » 29 Dec 2017, 16:35

kociubin wrote:
29 Dec 2017, 16:13
LisaM wrote:
29 Dec 2017, 14:22
Hi Andrew,

I've upgraded the wstest program to upyeasy_wifi_test program, it's source code is attached. Also the firmware in post 1 is upgraded. Can you flash that version and after the error run: import upyeasy_wifi_test

Cheers,

Lisa
Working: The 12/29 version boots fine. It connects to WiFi. NTP works. I'm able to make configuration changes using the webUI.
Not Working: Not able to read any of the GPIOs using the switch plugin.

Let me know if I should be doing something special to get the switch plugin working.
It's on my todo list, together with the BME280 running on I2C. I'll give it a look today, will let you know.

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: ESP32 boards

#28 Post by LisaM » 29 Dec 2017, 16:38

AndrewJ wrote:
29 Dec 2017, 15:56
I then did import upyeasy_wifi_test
I got this...

Code: Select all

>>> import upyeasy_wifi_test
Starting uPyEasy Webserver test...
I (57239) network: event 1
SSID:  TALKTALK65AFF2  Channel:  11 Strength:  -28  Security type:  0
Trying to connect to AP:  TALKTALK65AFF2
Bind address info: [(2, 1, 0, '0.0.0.0', ('0.0.0.0', 80))]
Listening, connect your browser to http://<this_host>:80/
This looks like it made the wifi connection to my AP (confirmed through the router interface, address is 192.168.1.18)
What I don't understand is the Bind address info, why is it showing '0.0.0.0' ?
I tried to connect my browser to 192.168.1.18:80 but after quite a long time it timed out with

Code: Select all

This site can’t be reached
192.168.1.18 took too long to respond.
I'm not sure what I should put for <this_host> in the Listening, etc line? Am I right by putting the IP address I see in my router?
Cheers
Andrew
The 0.0.0.0 is the default IP-address, that should work. I'll upgrade the test program again to use the actual ip-address, will post it in post 1 in a few hours. I'll also build test program 2, to see if you make a connection with the outside world from the ESP32.

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: ESP32 boards

#29 Post by LisaM » 29 Dec 2017, 22:16

New firmware in post #1, includes upyeasy_wifi_test (wifi server test) and upyeasy_wifi_test2 (wifi client test). Both are using actual ip addresses.
Go ahead and try it out, sources are also attached.
Attachments
upyeasy-test.zip
(1.99 KiB) Downloaded 62 times

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: ESP32 boards

#30 Post by LisaM » 29 Dec 2017, 22:20

budman1758 wrote:
29 Dec 2017, 09:12
I hate to be "that guy" :roll: but would you happen to have a windows flashing howto laying around anywhere? I'm not having much luck here.... :mrgreen:
Windows? The esp-tool is the same, since it's python... ;)
Install python on your windows pc, replace '/dev/ttyUSBx' with comX and you're done.

kociubin
Normal user
Posts: 11
Joined: 09 Nov 2017, 02:48

Re: ESP32 boards

#31 Post by kociubin » 30 Dec 2017, 02:17

LisaM wrote:
29 Dec 2017, 22:20
budman1758 wrote:
29 Dec 2017, 09:12
I hate to be "that guy" :roll: but would you happen to have a windows flashing howto laying around anywhere? I'm not having much luck here.... :mrgreen:
Windows? The esp-tool is the same, since it's python... ;)
Install python on your windows pc, replace '/dev/ttyUSBx' with comX and you're done.
You may need to change the order of parameters on windows but it does work. Try something like this (replace COM5 with your number):

Code: Select all

esptool.py --port COM5 write_flash 0x1000 upyeasy-esp32.bin --compress 

User avatar
budman1758
Normal user
Posts: 234
Joined: 15 Apr 2017, 05:13
Location: Riverside CA USA

Re: ESP32 boards

#32 Post by budman1758 » 30 Dec 2017, 03:29

After installing Python I keep getting this error:

Code: Select all

import serial
ImportError: No module named serial
Did some research... Installed pyserial..... Same message
Have tried to reinstall pyserial several times and keep getting the message that it's already installed. Also rebooted with no change.

I am running pretty short on hair to pull out. :lol: :lol:

Expressif has a different Flash download tool on its website and I have used it b4 but not having much luck with this. Probably settings (of which there are LOTS) are not correct. I have tried a few different things but no luck so far. Has anyone had success with it?
"The glass is twice as big as it needs to be".

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: ESP32 boards

#33 Post by LisaM » 30 Dec 2017, 14:56

budman1758 wrote:
30 Dec 2017, 03:29
After installing Python I keep getting this error:

Code: Select all

import serial
ImportError: No module named serial
Did some research... Installed pyserial..... Same message
Have tried to reinstall pyserial several times and keep getting the message that it's already installed. Also rebooted with no change.

I am running pretty short on hair to pull out. :lol: :lol:

Expressif has a different Flash download tool on its website and I have used it b4 but not having much luck with this. Probably settings (of which there are LOTS) are not correct. I have tried a few different things but no luck so far. Has anyone had success with it?
You need to provide us with a context if you want us to help you...
For example:

Code: Select all

PS C:\Users\Lisa> python
Python 3.6.2 (v3.6.2:5fd33b5, Jul  8 2017, 04:14:34) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> help('modules')

Please wait a moment while I gather a list of all available modules...

__future__          abc                 heapq               select
_ast                aifc                hmac                selectors
_asyncio            antigravity         html                serial
_bisect             argparse            http                setuptools
_blake2             array               idlelib             shelve
_bootlocale         ast                 imaplib             shlex
_bz2                asynchat            imghdr              shutil
_codecs             asyncio             imp                 signal
_codecs_cn          asyncore            importlib           site
_codecs_hk          atexit              inspect             six
_codecs_iso2022     audioop             io                  smtpd
_codecs_jp          base64              ipaddress           smtplib
_codecs_kr          bdb                 itertools           sndhdr
_codecs_tw          binascii            json                socket
_collections        binhex              keyword             socketserver
_collections_abc    bisect              lib2to3             sqlite3
_compat_pickle      builtins            linecache           sre_compile
_compression        bz2                 locale              sre_constants
_csv                cProfile            logging             sre_parse
_ctypes             calendar            lzma                ssl
_ctypes_test        cgi                 macpath             stat
_datetime           cgitb               macurl2path         statistics
_decimal            chunk               mailbox             string
_dummy_thread       cmath               mailcap             stringprep
_elementtree        cmd                 marshal             struct
_functools          code                math                subprocess
_hashlib            codecs              mimetypes           sunau
_heapq              codeop              mmap                symbol
_imp                collections         modulefinder        symtable
_io                 colorama            mp                  sys
_json               colorsys            msilib              sysconfig
_locale             compileall          msvcrt              tabnanny
_lsprof             concurrent          multiprocessing     tarfile
_lzma               configparser        netrc               telnetlib
_markupbase         contextlib          nntplib             tempfile
_md5                copy                nt                  test
_msi                copyreg             ntpath              textwrap
_multibytecodec     crypt               nturl2path          this
_multiprocessing    csv                 numbers             threading
_opcode             ctypes              opcode              time
_operator           curses              operator            timeit
_osx_support        datetime            optparse            tkinter
_overlapped         dbm                 os                  token
_pickle             decimal             parser              tokenize
_pydecimal          difflib             pathlib             trace
_pyio               dis                 pdb                 traceback
_random             distutils           pickle              tracemalloc
_sha1               doctest             pickletools         tty
_sha256             dummy_threading     pip                 turtle
_sha3               easy_install        pipes               turtledemo
_sha512             ecdsa               pkg_resources       types
_signal             email               pkgutil             typing
_sitebuiltins       encodings           platform            unicodedata
_socket             ensurepip           plistlib            unittest
_sqlite3            enum                poplib              urllib
_sre                errno               posixpath           uu
_ssl                espefuse            pprint              uuid
_stat               espsecure           profile             venv
_string             esptool             pstats              warnings
_strptime           faulthandler        pty                 wave
_struct             filecmp             py_compile          weakref
_symtable           fileinput           pyaes               webbrowser
_testbuffer         fnmatch             pyclbr              websocket
_testcapi           formatter           pydoc               winreg
_testconsole        fractions           pydoc_data          winsound
_testimportmultiple ftplib              pyexpat             wsgiref
_testmultiphase     functools           queue               xdrlib
_thread             gc                  quopri              xml
_threading_local    genericpath         random              xmlrpc
_tkinter            getopt              re                  xxsubtype
_tracemalloc        getpass             reprlib             zipapp
_warnings           gettext             rlcompleter         zipfile
_weakref            glob                runpy               zipimport
_weakrefset         gzip                sched               zlib
_winapi             hashlib             secrets

Enter any module name to get more help.  Or, type "modules spam" to search
for modules whose name or summary contain the string "spam".

>>> help('modules serial')

Here is a list of modules whose name or summary contains 'serial'.
If there are any, enter a module name to get more help.

pickle - Create portable serialized representations of Python objects.
mp.conserial
pip._vendor.cachecontrol.serialize
pip._vendor.html5lib.serializer
serial
serial.aio - Support asyncio with serial ports. EXPERIMENTAL
serial.rfc2217
serial.rs485 - The settings for RS485 are stored in a dedicated object that can be applied to
serial.serialcli
serial.serialjava
serial.serialposix
serial.serialutil
serial.serialwin32
serial.threaded - Support threading with serial ports.
serial.tools
serial.tools.hexlify_codec - Python 'hex' Codec - 2-digit hex with spaces content transfer encoding.
serial.tools.list_ports - This module will provide a function called comports that returns an
serial.tools.list_ports_common
serial.tools.list_ports_linux
serial.tools.list_ports_osx
serial.tools.list_ports_posix - The ``comports`` function is expected to return an iterable that yields tuples
serial.tools.list_ports_windows
serial.tools.miniterm
serial.urlhandler
serial.urlhandler.protocol_alt
serial.urlhandler.protocol_hwgrep
serial.urlhandler.protocol_loop
serial.urlhandler.protocol_rfc2217
serial.urlhandler.protocol_serve-rfc2217
serial.urlhandler.protocol_socket
serial.urlhandler.protocol_spy
serial.win32

>>>
You can see serial is part of the modules, is that true for you also?

kociubin
Normal user
Posts: 11
Joined: 09 Nov 2017, 02:48

Re: ESP32 boards

#34 Post by kociubin » 30 Dec 2017, 15:11

budman1758 wrote:
30 Dec 2017, 03:29
After installing Python I keep getting this error:

Code: Select all

import serial
ImportError: No module named serial
Did some research... Installed pyserial..... Same message
Have tried to reinstall pyserial several times and keep getting the message that it's already installed. Also rebooted with no change.

I am running pretty short on hair to pull out. :lol: :lol:

Expressif has a different Flash download tool on its website and I have used it b4 but not having much luck with this. Probably settings (of which there are LOTS) are not correct. I have tried a few different things but no luck so far. Has anyone had success with it?
Make sure you're installing pyserial into the same instance of python that you're using to run the flash tool.

AndrewJ
Normal user
Posts: 229
Joined: 14 Feb 2017, 12:38

Re: ESP32 boards

#35 Post by AndrewJ » 30 Dec 2017, 18:23

LisaM wrote:
29 Dec 2017, 22:16
New firmware in post #1, includes upyeasy_wifi_test (wifi server test) and upyeasy_wifi_test2 (wifi client test). Both are using actual ip addresses.
Go ahead and try it out, sources are also attached.
Hi Lisa,
I tried this on my LOLIN32 LITE board. First I erased, then flashed the latest version of upyeasy_esp32. Got the OSError 128 as before. This is the log.
First it looks good...

Code: Select all

Chip is ESP32D0WDQ6 (revision 1)
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Flash params set to 0x0220
Compressed 1166064 bytes to 682170...
Wrote 1166064 bytes (682170 compressed) at 0x00001000 in 61.6 seconds (effective 151.3 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting...
pi@homeassistant:~/upyeasy_esp32/esptool-master291217 $  #restarted ESP using on-board RESET button
pi@homeassistant:~/upyeasy_esp32/esptool-master291217 $
pi@homeassistant:~/upyeasy_esp32/esptool-master291217 $ screen /dev/ttyUSB0 115200,cs8
2000-01-01 00:00:09 [debug] uPyEasy-uPyEasy: Hal: Entering SetTime
2000-01-01 00:00:09 [debug] uPyEasy-uPyEasy: Hal: Entering GetNtpTime
2000-01-01 00:00:09 [debug] uPyEasy-uPyEasy: Hal: network Table
2000-01-01 00:00:09 [debug] uPyEasy-uPyEasy: Hal: Using NTP Hostname: pool.ntp.org
2000-01-01 00:00:09 [debug] uPyEasy-uPyEasy: Hal: TimeZome offset: 60
2000-01-01 00:00:09 [debug] uPyEasy-uPyEasy: Hal: Received UTC NTP Time: 567968095
2000-01-01 00:00:09 [debug] uPyEasy-uPyEasy: Hal: Timezone corrected NTP Time: 567971695
2000-01-01 00:00:09 [debug] uPyEasy-uPyEasy: Hal: DST corrected NTP Time: 567971695
2000-01-01 00:00:09 [debug] uPyEasy-uPyEasy: Hal: Received NTP Time: 567971695
2017-12-30 17:55:04 [debug] uPyEasy-uPyEasy: Hal: StartTime: 567971695
2017-12-30 17:55:04 [debug] uPyEasy-uPyEasy: Hal: SetTime: NO RTC!
2017-12-30 17:55:04 [debug] uPyEasy-uPyEasy: Main: Pre-loading home page
2017-12-30 17:55:04 [debug] uPyEasy-uPyEasy: Hal: get_ip_address esp32, ip: 192.168.1.18
2017-12-30 17:55:05 [debug] uPyEasy-uPyEasy: Main: uPyEasy Main Async Loop
* Running on http://192.168.1.18:80/
2017-12-30 17:55:05 [debug] uPyEasy-uPyEasy: Protocols: Async processing protocols
2017-12-30 17:55:05 [debug] uPyEasy-uPyEasy: Plugins: Async processing plugins
but then comes my old friend, the OSError 128...

Code: Select all

Traceback (most recent call last):
  File "boot.py", line 3, in <module>
  File "upyeasy/__init__.py", line 56, in main
  File "picoweb/__init__.py", line 275, in run
  File "uasyncio/core.py", line 138, in run_forever
  File "uasyncio/core.py", line 97, in run_forever
  File "uasyncio/__init__.py", line 249, in start_server
OSError: 128
OSError: [Errno 2] ENOENT
MicroPython v1.9.3-194-ga661b85-dirty on 2017-12-29; ESP32 module with ESP32
Type "help()" for more information.
>>>
(I'm assuming the second error, ENOENT, is still the one about "missing main.py"?)

Then I imported upyeasy_wifi_test, and get this....

Code: Select all

>>> import upyeasy_wifi_test
Starting uPyEasy Webserver test...
I (553858) network: event 1
SSID:  TALKTALK65AFF2  Channel:  11 Strength:  -33  Security type:  0
Trying to connect to AP:  TALKTALK65AFF2
Bind address info: [(2, 1, 0, '192.168.1.18', ('192.168.1.18', 80))]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "upyeasy_wifi_test.py", line 75, in <module>
  File "upyeasy_wifi_test.py", line 52, in main
OSError: [Errno 12] ENOMEM
>>>
So, it has seen my wifi and obtained an IP-address, but then hit OSError 12 ENOMEM.
I googled this error and found this, relating to ESP8266, but not sure whether this is what is happening now:
https://github.com/micropython/micropython/issues/1897

My router is seeing the ESP32 at 192.168.1.18, so that bit has worked. I tried to connect to this ip on port 80 from my browser (after the above error) but (perhaps not surprisingly) it timed out. Interestingly, I can ping it and it responds.

I'd be glad of any comments or suggestions, please? ;)

p.s. I didn't (yet) try the second test, I thought it best to take one step at a time.
pps. All the above is on my LOLIN32 LITE ESP board. I'm still leaving the DOIT devkit for later, mainly because it has the Revision 0 ESP chip rather than Revision 1.

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: ESP32 boards

#36 Post by LisaM » 30 Dec 2017, 19:16

Andrew, the nomem error is due to lack of memory. Just reboot and press ctrl-c somewhere at the NTP debug messages. Then try test program.

AndrewJ
Normal user
Posts: 229
Joined: 14 Feb 2017, 12:38

Re: ESP32 boards

#37 Post by AndrewJ » 30 Dec 2017, 21:23

LisaM wrote:
30 Dec 2017, 19:16
Andrew, the nomem error is due to lack of memory. Just reboot and press ctrl-c somewhere at the NTP debug messages. Then try test program.
Hi Lisa,
Thanks for that. I just want to be sure I understand step-by-step what you are suggesting. Is it this ?...
1. From freshly flashed condition, restart the ESP32. (does this need to be by pulling the USB plug, or is pressing the reset button ok?)
2. When the debug messages get to NTP debug or there abouts, do I reboot again ?? (USB plug? reset button?)
3. Immediately press ctrl-c
4. not sure quite what will happen next
5. type in import upyeasy_wifi_test at the REPL prompt and see what happens

Hope I've got this right, but please correct where necessary. Sorry if I'm missing something obvious - it's all a bit new! ;)
Cheers
Andrew

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: ESP32 boards

#38 Post by LisaM » 30 Dec 2017, 21:42

AndrewJ wrote:
30 Dec 2017, 21:23
LisaM wrote:
30 Dec 2017, 19:16
Andrew, the nomem error is due to lack of memory. Just reboot and press ctrl-c somewhere at the NTP debug messages. Then try test program.
Hi Lisa,
Thanks for that. I just want to be sure I understand step-by-step what you are suggesting. Is it this ?...
1. From freshly flashed condition, restart the ESP32. (does this need to be by pulling the USB plug, or is pressing the reset button ok?)
2. When the debug messages get to NTP debug or there abouts, do I reboot again ?? (USB plug? reset button?)
3. Immediately press ctrl-c
4. not sure quite what will happen next
5. type in import upyeasy_wifi_test at the REPL prompt and see what happens

Hope I've got this right, but please correct where necessary. Sorry if I'm missing something obvious - it's all a bit new! ;)
Cheers
Andrew
Pressing reset button is enough, then press ctrl-c as soon as you see upyeasy debug messages. uPyEasy aborts and returns to the repl prompt. Type import upyeasy_wifi_test and see what happens.

AndrewJ
Normal user
Posts: 229
Joined: 14 Feb 2017, 12:38

Re: ESP32 boards

#39 Post by AndrewJ » 30 Dec 2017, 22:00

LisaM wrote:
30 Dec 2017, 21:42
AndrewJ wrote:
30 Dec 2017, 21:23
LisaM wrote:
30 Dec 2017, 19:16
Andrew, the nomem error is due to lack of memory. Just reboot and press ctrl-c somewhere at the NTP debug messages. Then try test program.
Hi Lisa,
Thanks for that. I just want to be sure I understand step-by-step what you are suggesting. Is it this ?...
1. From freshly flashed condition, restart the ESP32. (does this need to be by pulling the USB plug, or is pressing the reset button ok?)
2. When the debug messages get to NTP debug or there abouts, do I reboot again ?? (USB plug? reset button?)
3. Immediately press ctrl-c
4. not sure quite what will happen next
5. type in import upyeasy_wifi_test at the REPL prompt and see what happens

Hope I've got this right, but please correct where necessary. Sorry if I'm missing something obvious - it's all a bit new! ;)
Cheers
Andrew
Pressing reset button is enough, then press ctrl-c as soon as you see upyeasy debug messages. uPyEasy aborts and returns to the repl prompt. Type import upyeasy_wifi_test and see what happens.
OK, thks for clarification. I did that, I'm still not sure if I pressed ctrl-c at the right point. Anyway, this is the output I got...

Code: Select all


I (5908) wifi: state: auth -> assoc (0)
I (5918) wifi: state: assoc -> run (10)
I (5918) wifi: connected with TALKTALK65AFF2, channel 11
I (5918) network: event 4
I (6728) event: sta ip: 192.168.1.9, mask: 255.255.255.0, gw: 192.168.1.1
I (6728) network: GOT_IP
2000-01-01 00:00:06 [debug] uPyEasy: Hal: esp32, ip: 192.168.1.9
2000-01-01 00:00:06 [debug] uPyEasy: Hal: nic present
2000-01-01 00:00:06 [debug] uPyEasy: Protocols: Load
2000-01-01 00:00:06 [debug] uPyEasy: Protocols: Init protocol records
2000-01-01 00:00:07 [debug] uPyEasy: Protocols: Load protocol domoticz_mqtt
2000-01-01 00:00:07 [debug] uPyEasy: Protocols: Create protocol Record: domoticz_mqtt
2000-01-01 00:00:07 [debug] uPyEasy: Protocols: Load protocol domoticz_http
2000-01-01 00:00:07 [debug] uPyEasy: Protocols: Create protocol Record: domoticz_http
2000-01-01 00:00:07 [debug] uPyEasy: Protocols: Init protocol records, run async loop
2000-01-01 00:00:07 [debug] uPyEasy: Plugins: Load
2000-01-01 00:00:07 [debug] uPyEasy: Plugins: init plugin records
2000-01-01 00:00:08 [debug] uPyEasy: Plugins: Load frozen plugin switch
2000-01-01 00:00:08 [debug] uPyEasy: Plugin: switch contruction
2000-01-01 00:00:08 [debug] uPyEasy: Plugins: Create frozen plugin Record: switch
2000-01-01 00:00:08 [debug] uPyEasy: Plugins: Load frozen plugin ds18
2000-01-01 00:00:08 [debug] uPyEasy: Plugin: ds18 contruction
2000-01-01 00:00:08 [debug] uPyEasy: Plugins: Create frozen plugin Record: ds18
I (8948) wifi: pm start, type:0

2000-01-01 00:00:08 [debug] uPyEasy: Plugins: Init plugin records, run async loop
2000-01-01 00:00:08 [debug] uPyEasy: Utils: Sys hostname
2000-01-01 00:00:09 [debug] uPyEasy: Utils: uPyEasy Name
Set syslog hostname 0.0.0.0
reloaded sink syslog
2000-01-01 00:00:09 [debug] uPyEasy-uPyEasy: Hal: Entering SetTime
2000-01-01 00:00:09 [debug] uPyEasy-uPyEasy: Hal: Entering GetNtpTime
2000-01-01 00:00:09 [debug] uPyEasy-uPyEasy: Hal: network Table
2000-01-01 00:00:09 [debug] uPyEasy-uPyEasy: Hal: Using NTP Hostname: pool.ntp.org
2000-01-01 00:00:09 [debug] uPyEasy-uPyEasy: Hal: TimeZome offset: 60
Traceback (most recent call last):
  File "boot.py", line 3, in <module>
  File "upyeasy/__init__.py", line 40, in main
  File "upyeasy/init.py", line 224, in init
  File "upyeasy/hal.py", line 334, in settime
  File "upyeasy/hal.py", line 272, in getntptime
  File "upyeasy/hal.py", line 268, in getntptime
KeyboardInterrupt:
OSError: [Errno 2] ENOENT
MicroPython v1.9.3-194-ga661b85-dirty on 2017-12-29; ESP32 module with ESP32
Type "help()" for more information.
>>>
>>> import upyeasy_wifi_test
Starting uPyEasy Webserver test...
I (32758) network: event 1
SSID:  TALKTALK65AFF2  Channel:  11 Strength:  -28  Security type:  0
Trying to connect to AP:  TALKTALK65AFF2
Bind address info: [(2, 1, 0, '192.168.1.9', ('192.168.1.9', 80))]
Listening, connect your browser to http://<this_host>:80/
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "upyeasy_wifi_test.py", line 75, in <module>
  File "upyeasy_wifi_test.py", line 57, in main
OSError: 128
>>>

User avatar
budman1758
Normal user
Posts: 234
Joined: 15 Apr 2017, 05:13
Location: Riverside CA USA

Re: ESP32 boards

#40 Post by budman1758 » 31 Dec 2017, 01:06

LisaM wrote:
30 Dec 2017, 14:56
You need to provide us with a context if you want us to help you...
For example:

Code: Select all

PS C:\Users\Lisa> python
Python 3.6.2 (v3.6.2:5fd33b5, Jul  8 2017, 04:14:34) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> help('modules')

Please wait a moment while I gather a list of all available modules...

__future__          abc                 heapq               select
_ast                aifc                hmac                selectors
_asyncio            antigravity         html                serial
_bisect             argparse            http                setuptools
_blake2             array               idlelib             shelve
_bootlocale         ast                 imaplib             shlex
_bz2                asynchat            imghdr              shutil
_codecs             asyncio             imp                 signal
_codecs_cn          asyncore            importlib           site
_codecs_hk          atexit              inspect             six
_codecs_iso2022     audioop             io                  smtpd
_codecs_jp          base64              ipaddress           smtplib
_codecs_kr          bdb                 itertools           sndhdr
_codecs_tw          binascii            json                socket
_collections        binhex              keyword             socketserver
_collections_abc    bisect              lib2to3             sqlite3
_compat_pickle      builtins            linecache           sre_compile
_compression        bz2                 locale              sre_constants
_csv                cProfile            logging             sre_parse
_ctypes             calendar            lzma                ssl
_ctypes_test        cgi                 macpath             stat
_datetime           cgitb               macurl2path         statistics
_decimal            chunk               mailbox             string
_dummy_thread       cmath               mailcap             stringprep
_elementtree        cmd                 marshal             struct
_functools          code                math                subprocess
_hashlib            codecs              mimetypes           sunau
_heapq              codeop              mmap                symbol
_imp                collections         modulefinder        symtable
_io                 colorama            mp                  sys
_json               colorsys            msilib              sysconfig
_locale             compileall          msvcrt              tabnanny
_lsprof             concurrent          multiprocessing     tarfile
_lzma               configparser        netrc               telnetlib
_markupbase         contextlib          nntplib             tempfile
_md5                copy                nt                  test
_msi                copyreg             ntpath              textwrap
_multibytecodec     crypt               nturl2path          this
_multiprocessing    csv                 numbers             threading
_opcode             ctypes              opcode              time
_operator           curses              operator            timeit
_osx_support        datetime            optparse            tkinter
_overlapped         dbm                 os                  token
_pickle             decimal             parser              tokenize
_pydecimal          difflib             pathlib             trace
_pyio               dis                 pdb                 traceback
_random             distutils           pickle              tracemalloc
_sha1               doctest             pickletools         tty
_sha256             dummy_threading     pip                 turtle
_sha3               easy_install        pipes               turtledemo
_sha512             ecdsa               pkg_resources       types
_signal             email               pkgutil             typing
_sitebuiltins       encodings           platform            unicodedata
_socket             ensurepip           plistlib            unittest
_sqlite3            enum                poplib              urllib
_sre                errno               posixpath           uu
_ssl                espefuse            pprint              uuid
_stat               espsecure           profile             venv
_string             esptool             pstats              warnings
_strptime           faulthandler        pty                 wave
_struct             filecmp             py_compile          weakref
_symtable           fileinput           pyaes               webbrowser
_testbuffer         fnmatch             pyclbr              websocket
_testcapi           formatter           pydoc               winreg
_testconsole        fractions           pydoc_data          winsound
_testimportmultiple ftplib              pyexpat             wsgiref
_testmultiphase     functools           queue               xdrlib
_thread             gc                  quopri              xml
_threading_local    genericpath         random              xmlrpc
_tkinter            getopt              re                  xxsubtype
_tracemalloc        getpass             reprlib             zipapp
_warnings           gettext             rlcompleter         zipfile
_weakref            glob                runpy               zipimport
_weakrefset         gzip                sched               zlib
_winapi             hashlib             secrets

Enter any module name to get more help.  Or, type "modules spam" to search
for modules whose name or summary contain the string "spam".

>>> help('modules serial')

Here is a list of modules whose name or summary contains 'serial'.
If there are any, enter a module name to get more help.

pickle - Create portable serialized representations of Python objects.
mp.conserial
pip._vendor.cachecontrol.serialize
pip._vendor.html5lib.serializer
serial
serial.aio - Support asyncio with serial ports. EXPERIMENTAL
serial.rfc2217
serial.rs485 - The settings for RS485 are stored in a dedicated object that can be applied to
serial.serialcli
serial.serialjava
serial.serialposix
serial.serialutil
serial.serialwin32
serial.threaded - Support threading with serial ports.
serial.tools
serial.tools.hexlify_codec - Python 'hex' Codec - 2-digit hex with spaces content transfer encoding.
serial.tools.list_ports - This module will provide a function called comports that returns an
serial.tools.list_ports_common
serial.tools.list_ports_linux
serial.tools.list_ports_osx
serial.tools.list_ports_posix - The ``comports`` function is expected to return an iterable that yields tuples
serial.tools.list_ports_windows
serial.tools.miniterm
serial.urlhandler
serial.urlhandler.protocol_alt
serial.urlhandler.protocol_hwgrep
serial.urlhandler.protocol_loop
serial.urlhandler.protocol_rfc2217
serial.urlhandler.protocol_serve-rfc2217
serial.urlhandler.protocol_socket
serial.urlhandler.protocol_spy
serial.win32

>>>
You can see serial is part of the modules, is that true for you also?
Here is the output I get with those commands. Looks exactly the same.

Code: Select all

C:\>python
Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> help('modules')

Please wait a moment while I gather a list of all available modules...

__future__          _weakref            heapq               select
_ast                _weakrefset         hmac                selectors
_asyncio            _winapi             html                serial  <<<<<<
_bisect             abc                 http                setuptools
_blake2             aifc                idlelib             shelve
_bootlocale         antigravity         imaplib             shlex
_bz2                argparse            imghdr              shutil
_codecs             array               imp                 signal
_codecs_cn          ast                 importlib           site
_codecs_hk          asynchat            inspect             smtpd
_codecs_iso2022     asyncio             io                  smtplib
_codecs_jp          asyncore            ipaddress           sndhdr
_codecs_kr          atexit              itertools           socket
_codecs_tw          audioop             json                socketserver
_collections        base64              keyword             sqlite3
_collections_abc    bdb                 lib2to3             sre_compile
_compat_pickle      binascii            linecache           sre_constants
_compression        binhex              locale              sre_parse
_csv                bisect              logging             ssl
_ctypes             builtins            lzma                stat
_ctypes_test        bz2                 macpath             statistics
_datetime           cProfile            macurl2path         string
_decimal            calendar            mailbox             stringprep
_dummy_thread       cgi                 mailcap             struct
_elementtree        cgitb               marshal             subprocess
_findvs             chunk               math                sunau
_functools          cmath               mimetypes           symbol
_hashlib            cmd                 mmap                symtable
_heapq              code                modulefinder        sys
_imp                codecs              msilib              sysconfig
_io                 codeop              msvcrt              tabnanny
_json               collections         multiprocessing     tarfile
_locale             colorsys            netrc               telnetlib
_lsprof             compileall          nntplib             tempfile
_lzma               concurrent          nt                  test
_markupbase         configparser        ntpath              textwrap
_md5                contextlib          nturl2path          this
_msi                copy                numbers             threading
_multibytecodec     copyreg             opcode              time
_multiprocessing    crypt               operator            timeit
_opcode             csv                 optparse            tkinter
_operator           ctypes              os                  token
_osx_support        curses              parser              tokenize
_overlapped         datetime            pathlib             trace
_pickle             dbm                 pdb                 traceback
_pydecimal          decimal             pickle              tracemalloc
_pyio               difflib             pickletools         tty
_random             dis                 pip                 turtle
_sha1               distutils           pipes               turtledemo
_sha256             doctest             pkg_resources       types
_sha3               dummy_threading     pkgutil             typing
_sha512             easy_install        platform            unicodedata
_signal             email               plistlib            unittest
_sitebuiltins       encodings           poplib              urllib
_socket             ensurepip           posixpath           uu
_sqlite3            enum                pprint              uuid
_sre                errno               profile             venv
_ssl                faulthandler        pstats              warnings
_stat               filecmp             pty                 wave
_string             fileinput           py_compile          weakref
_strptime           fnmatch             pyclbr              webbrowser
_struct             formatter           pydoc               winreg
_symtable           fractions           pydoc_data          winsound
_testbuffer         ftplib              pyexpat             wsgiref
_testcapi           functools           queue               xdrlib
_testconsole        gc                  quopri              xml
_testimportmultiple genericpath         random              xmlrpc
_testmultiphase     getopt              re                  xxsubtype
_thread             getpass             reprlib             zipapp
_threading_local    gettext             rlcompleter         zipfile
_tkinter            glob                runpy               zipimport
_tracemalloc        gzip                sched               zlib
_warnings           hashlib             secrets

Enter any module name to get more help.  Or, type "modules spam" to search
for modules whose name or summary contain the string "spam".

>>> help('modules serial')

Here is a list of modules whose name or summary contains 'serial'.
If there are any, enter a module name to get more help.

pickle - Create portable serialized representations of Python objects.
pip._vendor.cachecontrol.serialize
pip._vendor.html5lib.serializer
serial
serial.aio - Support asyncio with serial ports. EXPERIMENTAL
serial.rfc2217
serial.rs485 - The settings for RS485 are stored in a dedicated object that can be applied to
serial.serialcli
serial.serialjava
serial.serialposix
serial.serialutil
serial.serialwin32
serial.threaded - Support threading with serial ports.
serial.tools
serial.tools.hexlify_codec - Python 'hex' Codec - 2-digit hex with spaces content transfer encoding.
serial.tools.list_ports - This module will provide a function called comports that returns an
serial.tools.list_ports_common
serial.tools.list_ports_linux
serial.tools.list_ports_osx
serial.tools.list_ports_posix - The ``comports`` function is expected to return an iterable that yields tuples
serial.tools.list_ports_windows
serial.tools.miniterm
serial.urlhandler
serial.urlhandler.protocol_alt
serial.urlhandler.protocol_hwgrep
serial.urlhandler.protocol_loop
serial.urlhandler.protocol_rfc2217
serial.urlhandler.protocol_serve-rfc2217
serial.urlhandler.protocol_socket
serial.urlhandler.protocol_spy
serial.win32

>>>
kociubin wrote:
30 Dec 2017, 15:11


Make sure you're installing pyserial into the same instance of python that you're using to run the flash tool.
As far as I know there is only one instance of Python installed. I used the latest version Windows installer and used PIP to install pyserial. Still getting the same error.
I have no idea why or where to go from here.
"The glass is twice as big as it needs to be".

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: ESP32 boards

#41 Post by LisaM » 31 Dec 2017, 02:22

AndrewJ wrote:
30 Dec 2017, 22:00
>>> import upyeasy_wifi_test
Starting uPyEasy Webserver test...
I (32758) network: event 1
SSID: TALKTALK65AFF2 Channel: 11 Strength: -28 Security type: 0
Trying to connect to AP: TALKTALK65AFF2
Bind address info: [(2, 1, 0, '192.168.1.9', ('192.168.1.9', 80))]
Listening, connect your browser to http://<this_host>:80/
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "upyeasy_wifi_test.py", line 75, in <module>
File "upyeasy_wifi_test.py", line 57, in main
OSError: 128
>>>
Identical error at this point in the test script: sock, addr = s.accept()
So it's not upyeasy that is causing it... Searching for a solution...
You have the source code, experiment?
I'm waiting for my Lolin32 Pro to reproduce.

AndrewJ
Normal user
Posts: 229
Joined: 14 Feb 2017, 12:38

Re: ESP32 boards

#42 Post by AndrewJ » 02 Jan 2018, 20:50

LisaM wrote:
31 Dec 2017, 02:22

Identical error at this point in the test script: sock, addr = s.accept()
So it's not upyeasy that is causing it... Searching for a solution...
You have the source code, experiment?
I'm waiting for my Lolin32 Pro to reproduce.
Hi Lisa,
OK, tried a few things and made some progress. :)
Short version:
I kept thinking that the problem must be something about my network etc.
So I made a modified version of upyeasy_wifi_test, with port number 8000, tried this but still not connecting.
Changed to port 9000 and it works! As did 9080. :) :)
Capture.PNG
Capture.PNG (5.76 KiB) Viewed 7541 times
The above was using the LOLIN32 LITE board. I still haven't tried with the DOIT devkit v1 (revision 0 chip) (that's next!).

I tried to find a way to change the port number in upyeasy_esp32, but I think it is all frozen code (is that the right term?) anyway I couldn't do this.
I know you have a lot happening, but if/when you have a bit of time, could you please produce a modified version of upyeasy_esp32 firmware for port 9000 for me to try? - I think it will probably work. ;)
The ideal might be to have a user-specified port number, with 80 as default. Alternatively, are you open to sharing the source code so I could try to change it myself?

I still don't know why port 80 doesn't work. I looked for things like port forwarding as possible causes, but didn't find anything obvious. I do know that 8000 is used by Grafana, on a different IP-address, so maybe that is why that one didn't work when I tried.

With best wishes for the New Year!
AndrewJ

p.s. I have ordered a Lolin32 Pro.

EDIT: I noticed that my browser had managed to connect to the ESP32 for a few seconds before the OSError 128 kicked in. So I rebooted with the browser ready and managed to get to the
Config page. There I found a field for the Port number, put in 9000 and clicked Submit. It's now running stable!!! (So no need for a modified version ;) )
Thank you so much. :D :D
All screens appear to be basically working at first sight. I'll test it out further and let you know if I find any issues.

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: ESP32 boards

#43 Post by LisaM » 02 Jan 2018, 23:02

AndrewJ wrote:
02 Jan 2018, 20:50
LisaM wrote:
31 Dec 2017, 02:22

Identical error at this point in the test script: sock, addr = s.accept()
So it's not upyeasy that is causing it... Searching for a solution...
You have the source code, experiment?
I'm waiting for my Lolin32 Pro to reproduce.
Hi Lisa,
OK, tried a few things and made some progress. :)
Short version:
I kept thinking that the problem must be something about my network etc.
So I made a modified version of upyeasy_wifi_test, with port number 8000, tried this but still not connecting.
Changed to port 9000 and it works! As did 9080. :) :)
Capture.PNG
The above was using the LOLIN32 LITE board. I still haven't tried with the DOIT devkit v1 (revision 0 chip) (that's next!).

I tried to find a way to change the port number in upyeasy_esp32, but I think it is all frozen code (is that the right term?) anyway I couldn't do this.
I know you have a lot happening, but if/when you have a bit of time, could you please produce a modified version of upyeasy_esp32 firmware for port 9000 for me to try? - I think it will probably work. ;)
The ideal might be to have a user-specified port number, with 80 as default. Alternatively, are you open to sharing the source code so I could try to change it myself?

I still don't know why port 80 doesn't work. I looked for things like port forwarding as possible causes, but didn't find anything obvious. I do know that 8000 is used by Grafana, on a different IP-address, so maybe that is why that one didn't work when I tried.

With best wishes for the New Year!
AndrewJ

p.s. I have ordered a Lolin32 Pro.

EDIT: I noticed that my browser had managed to connect to the ESP32 for a few seconds before the OSError 128 kicked in. So I rebooted with the browser ready and managed to get to the
Config page. There I found a field for the Port number, put in 9000 and clicked Submit. It's now running stable!!! (So no need for a modified version ;) )
Thank you so much. :D :D
All screens appear to be basically working at first sight. I'll test it out further and let you know if I find any issues.
Hi Andrew,

Good news! Good work for finding out that ports above 8000 work.
Recently i've put a port extension in the setwifi command, the function now is:

Code: Select all

def setwifi(ssid,key,ssid2='',key2='', port=80):
Meaning that you can add the port in the end, or not, so it defaults to 80 but can be anything. I suspect port 8080 will also work.

AndrewJ
Normal user
Posts: 229
Joined: 14 Feb 2017, 12:38

Re: ESP32 boards

#44 Post by AndrewJ » 03 Jan 2018, 21:19

Hi Lisa,
I tried port 8080, but it didn't work for me, it went back to OSError 128. So I have settled on 9000, I put it in via the web interface in the short time before the error. Now running stable on my Wemos LOLIN32 LITE as I mentioned.

Today I tried the DOIT Devkit v1. I had a lot of trouble at first, which I eventually realised was (still) due to a poor/intermitent connection at the mini USB socket of the board. Eventually I changed to a brand new cable, which fits much more snugly, and managed to flash and run it successfully. I used the same trick of quickly changing the port in the Config page to 9000, and it is now running! ;)

I'm looking forward to trying new versions when you have some time available! Meanwhile I'll let you know any feedback I have about the Alpha version.
Thanks for all your hard work on this! :)
Andrew

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: ESP32 boards

#45 Post by LisaM » 03 Jan 2018, 23:45

AndrewJ wrote:
03 Jan 2018, 21:19
Hi Lisa,
I tried port 8080, but it didn't work for me, it went back to OSError 128. So I have settled on 9000, I put it in via the web interface in the short time before the error. Now running stable on my Wemos LOLIN32 LITE as I mentioned.

Today I tried the DOIT Devkit v1. I had a lot of trouble at first, which I eventually realised was (still) due to a poor/intermitent connection at the mini USB socket of the board. Eventually I changed to a brand new cable, which fits much more snugly, and managed to flash and run it successfully. I used the same trick of quickly changing the port in the Config page to 9000, and it is now running! ;)

I'm looking forward to trying new versions when you have some time available! Meanwhile I'll let you know any feedback I have about the Alpha version.
Thanks for all your hard work on this! :)
Andrew
Feedback is good, i love it... :D
Soon you will all be able to tinker with it, the letscontrolit uPyEasy github repository is already in place. Getting ready for beta-1.

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: ESP32 boards

#46 Post by LisaM » 05 Jan 2018, 22:27

Version: v53

Fixed:
- Time on ESP32
- Switch plugin

Added:
- I2C
- BME280 sensor

Database changes:
- None

AndrewJ
Normal user
Posts: 229
Joined: 14 Feb 2017, 12:38

Re: ESP32 boards

#47 Post by AndrewJ » 06 Jan 2018, 09:49

Thanks Lisa I'll give it a try. :)

Drum
Normal user
Posts: 285
Joined: 07 Feb 2016, 11:56

Re: ESP32 boards

#48 Post by Drum » 06 Jan 2018, 12:19

Just checked the espressif site to see if they have anything new and saw this
http://espressif.com/en/media_overview/ ... ntest-2018

Looks like a new dev board and esp32 chip I have not seen yet. Of course the oppertunity to get a dev board free is a nice option.

I have not read the fine print yet.

In any case the ESP32-PICO-D4 looks very interesting...

User avatar
ManS-H
Normal user
Posts: 233
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: ESP32 boards

#49 Post by ManS-H » 06 Jan 2018, 13:29

Drum wrote:
06 Jan 2018, 12:19
Just checked the espressif site to see if they have anything new and saw this
http://espressif.com/en/media_overview/ ... ntest-2018

Looks like a new dev board and esp32 chip I have not seen yet. Of course the oppertunity to get a dev board free is a nice option.

I have not read the fine print yet.

In any case the ESP32-PICO-D4 looks very interesting...
It's a ESP32 Design Contest.
Espressif co-organizes with Elektor International Media the ESP32 Design Contest in 2018.

Drum
Normal user
Posts: 285
Joined: 07 Feb 2016, 11:56

Re: ESP32 boards

#50 Post by Drum » 06 Jan 2018, 13:51

ManS-H wrote:
06 Jan 2018, 13:29
Drum wrote:
06 Jan 2018, 12:19
Just checked the espressif site to see if they have anything new and saw this
http://espressif.com/en/media_overview/ ... ntest-2018

Looks like a new dev board and esp32 chip I have not seen yet. Of course the oppertunity to get a dev board free is a nice option.

I have not read the fine print yet.

In any case the ESP32-PICO-D4 looks very interesting...
It's a ESP32 Design Contest.
Espressif co-organizes with Elektor International Media the ESP32 Design Contest in 2018.
Yes, I saw that. I just had not seen the ESP32-PICO-D4 chip or dev board previously....

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest