ESP32 boards

Moderators: BertB, Voyager, grovkillen, Stuntteam, LisaM

Message
Author
BertB
Normal user
Posts: 1020
Joined: 25 Apr 2015, 14:39

Re: ESP32 boards

#201 Post by BertB » 23 Mar 2018, 20:29

That makes two of us :-)

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

Re: ESP32 boards

#202 Post by AndrewJ » 23 Mar 2018, 20:48

Make that three! :D

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

Re: ESP32 boards

#203 Post by LisaM » 23 Mar 2018, 21:29

karl222 wrote:
23 Mar 2018, 20:27
LisaM wrote:
23 Mar 2018, 00:07
@karl222 @bertb
The errors in your log:
File "flashbdev.py", line 13, in readblocks
OSError: [Errno 5] EIO
means that the flashdrive could not be initialized, so that the database isn't build (no dir) and upyeasy fails. Did you flash the 2048 or the 4096 version?
hi,
have tried it with both files, both sShow the same issues... still not running...

I don't know what to do with BertB's findings... I would love to see a working .bin ;-)

regards
karl
The bin is good, but some ESP32's want to have the 4096 version and others the 2048. Can you try to do an erase before using the 2048 version?
esptool.py erase_flash

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

Re: ESP32 boards

#204 Post by LisaM » 23 Mar 2018, 21:32

AndrewJ wrote:
23 Mar 2018, 20:48
Make that three! :D
You and @bertb have devices that are not automatically updated and send to domoticz? Only the first, second or both?

karl222
Normal user
Posts: 88
Joined: 23 Aug 2017, 17:18
Location: Vienna

Re: ESP32 boards

#205 Post by karl222 » 23 Mar 2018, 21:39

I erased, then flashed with 2048 but no success.... :cry:

E:\esp32>esptool.py --port COM7 erase_flash
esptool.py v2.3.2-dev
Connecting........_
Detecting chip type... ESP32
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...
Chip erase completed successfully in 9.2s
Hard resetting via RTS pin...

E:\esp32>esptool.py --chip esp32 --port COM7 --baud 460800 write_flash --flash_freq 40m --flash_mode dio --flash_size 2MB -z 0x1000 upyeasy_v021_20180321_test_esp32_2048.bin
esptool.py v2.3.2-dev
Connecting....
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Compressed 1207952 bytes to 698892...
Wrote 1207952 bytes (698892 compressed) at 0x00001000 in 21.5 seconds (effective 450.4 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

and 4096:

rst:0x1 (POWERON_RESET),boot:0x33 (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:0x3fff0018,len:4
load:0x3fff001c,len:4364
load:0x40078000,len:0
load:0x40078000,len:10992
entry 0x4007a6c4
I (442) cpu_start: Pro cpu up.
I (442) cpu_start: Single core mode
I (443) heap_init: Initializing. RAM available for dynamic allocation:
I (446) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (452) heap_init: At 3FFDCDD0 len 00003230 (12 KiB): DRAM
I (458) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (464) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (471) heap_init: At 4009005C len 0000FFA4 (63 KiB): IRAM
I (477) cpu_start: Pro cpu start user code
I (47) cpu_start: Starting scheduler on PRO CPU.
Traceback (most recent call last):
File "_boot.py", line 10, in <module>
File "inisetup.py", line 28, in setup
File "inisetup.py", line 6, in check_bootsec
File "flashbdev.py", line 13, in readblocks
OSError: [Errno 5] EIO
OSError: [Errno 1] EPERM
OSError: [Errno 1] EPERM
MicroPython v1.9.3-255-g979c688-dirty on 2018-03-21; ESP32 module with ESP32
Type "help()" for more information.
>>>

karl222
Normal user
Posts: 88
Joined: 23 Aug 2017, 17:18
Location: Vienna

Re: ESP32 boards

#206 Post by karl222 » 23 Mar 2018, 22:09

I tried both files on my second board, an esp32 wroom NODEMCU ESP-32S V1 as well, but didn't work either... :(

BertB
Normal user
Posts: 1020
Joined: 25 Apr 2015, 14:39

Re: ESP32 boards

#207 Post by BertB » 24 Mar 2018, 00:09

LisaM wrote:
23 Mar 2018, 21:32
AndrewJ wrote:
23 Mar 2018, 20:48
Make that three! :D
You and @bertb have devices that are not automatically updated and send to domoticz? Only the first, second or both?
I have two devices, neither one is updated.

BertB
Normal user
Posts: 1020
Joined: 25 Apr 2015, 14:39

Re: ESP32 boards

#208 Post by BertB » 24 Mar 2018, 00:21

With the 4096 bin, I get the:
OSError: [Errno 5] EIO
OSError: [Errno 1] EPERM
OSError: [Errno 1] EPERM

errors.

raptor
Normal user
Posts: 25
Joined: 25 Oct 2016, 10:39
Location: Montana / Bulgaria

Re: ESP32 boards

#209 Post by raptor » 24 Mar 2018, 14:54

Hello, guys! You can try my 4096 binary https://drive.google.com/file/d/1p1JFrk ... sp=sharing
It work for my esp-wroom-32 v2 board. If flashing is successful then insert these commands:

Code: Select all

import  upyeasy 
import network
station = network.WLAN(network.STA_IF)
station.active(True)
station.connect("your_ssid", "your_pass")
upyeasy.main()
If there is no errors you should have working board :)
Regards from Bulgaria.
raptor

BertB
Normal user
Posts: 1020
Joined: 25 Apr 2015, 14:39

Re: ESP32 boards

#210 Post by BertB » 24 Mar 2018, 17:14

Hi Raptor

Sorry to say, but nope:
ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x17 (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:0x3fff0018,len:4
load:0x3fff001c,len:4416
ho 0 tail 12 room 4
load:0x40078000,len:0
load:0x40078000,len:11816
entry 0x4007a9fc
I (450) cpu_start: Pro cpu up.
I (450) cpu_start: Single core mode
I (451) heap_init: Initializing. RAM available for dynamic allocation:
I (454) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (460) heap_init: At 3FFC4E80 len 0001B180 (108 KiB): DRAM
I (466) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (473) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (479) heap_init: At 4008DE34 len 000121CC (72 KiB): IRAM
I (485) cpu_start: Pro cpu start user code
I (56) cpu_start: Starting scheduler on PRO CPU.
Traceback (most recent call last):
File "_boot.py", line 10, in <module>
File "inisetup.py", line 28, in setup
File "inisetup.py", line 6, in check_bootsec
File "flashbdev.py", line 13, in readblocks
OSError: [Errno 5] EIO
OSError: [Errno 1] EPERM
OSError: [Errno 1] EPERM
MicroPython v1.9.3-473-g22c693a-dirty on 2018-03-22; ESP32 module with ESP32
Type "help()" for more information.
>>>

raptor
Normal user
Posts: 25
Joined: 25 Oct 2016, 10:39
Location: Montana / Bulgaria

Re: ESP32 boards

#211 Post by raptor » 24 Mar 2018, 17:42

Hi BertB

It seems to me that problem is in your module. Can you try with another esp32 module?
My module works with this firmware.
Regards from Bulgaria.
raptor

BertB
Normal user
Posts: 1020
Joined: 25 Apr 2015, 14:39

Re: ESP32 boards

#212 Post by BertB » 24 Mar 2018, 18:45

I already did.
Both modules, from different makers, fail.

raptor
Normal user
Posts: 25
Joined: 25 Oct 2016, 10:39
Location: Montana / Bulgaria

Re: ESP32 boards

#213 Post by raptor » 24 Mar 2018, 18:54

That is really strange :geek:
Regards from Bulgaria.
raptor

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

Re: ESP32 boards

#214 Post by LisaM » 24 Mar 2018, 19:10

BertB wrote:
24 Mar 2018, 00:21
With the 4096 bin, I get the:
OSError: [Errno 5] EIO
OSError: [Errno 1] EPERM
OSError: [Errno 1] EPERM

errors.
And with the 2048 firmware? Can you post the start log for that?

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

Re: ESP32 boards

#215 Post by LisaM » 24 Mar 2018, 19:12

karl222 wrote:
23 Mar 2018, 21:39
I erased, then flashed with 2048 but no success.... :cry:

E:\esp32>esptool.py --port COM7 erase_flash
esptool.py v2.3.2-dev
Connecting........_
Detecting chip type... ESP32
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...
Chip erase completed successfully in 9.2s
Hard resetting via RTS pin...

E:\esp32>esptool.py --chip esp32 --port COM7 --baud 460800 write_flash --flash_freq 40m --flash_mode dio --flash_size 2MB -z 0x1000 upyeasy_v021_20180321_test_esp32_2048.bin
esptool.py v2.3.2-dev
Connecting....
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Compressed 1207952 bytes to 698892...
Wrote 1207952 bytes (698892 compressed) at 0x00001000 in 21.5 seconds (effective 450.4 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

and 4096:

rst:0x1 (POWERON_RESET),boot:0x33 (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:0x3fff0018,len:4
load:0x3fff001c,len:4364
load:0x40078000,len:0
load:0x40078000,len:10992
entry 0x4007a6c4
I (442) cpu_start: Pro cpu up.
I (442) cpu_start: Single core mode
I (443) heap_init: Initializing. RAM available for dynamic allocation:
I (446) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (452) heap_init: At 3FFDCDD0 len 00003230 (12 KiB): DRAM
I (458) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (464) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (471) heap_init: At 4009005C len 0000FFA4 (63 KiB): IRAM
I (477) cpu_start: Pro cpu start user code
I (47) cpu_start: Starting scheduler on PRO CPU.
Traceback (most recent call last):
File "_boot.py", line 10, in <module>
File "inisetup.py", line 28, in setup
File "inisetup.py", line 6, in check_bootsec
File "flashbdev.py", line 13, in readblocks
OSError: [Errno 5] EIO
OSError: [Errno 1] EPERM
OSError: [Errno 1] EPERM
MicroPython v1.9.3-255-g979c688-dirty on 2018-03-21; ESP32 module with ESP32
Type "help()" for more information.
>>>
After you flashed with the 2048 firmware, can you post the start log after a reset?

BertB
Normal user
Posts: 1020
Joined: 25 Apr 2015, 14:39

Re: ESP32 boards

#216 Post by BertB » 24 Mar 2018, 20:20

This is with the 2048 bin
ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x3f (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:0x3fff0018,len:4
load:0x3fff001c,len:4364
load:0x40078000,len:0
load:0x40078000,len:10992
entry 0x4007a6c4
I (442) cpu_start: Pro cpu up.
I (442) cpu_start: Single core mode
I (442) heap_init: Initializing. RAM available for dynamic allocation:
I (446) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (452) heap_init: At 3FFDCDD0 len 00003230 (12 KiB): DRAM
I (458) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (464) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (471) heap_init: At 4009005C len 0000FFA4 (63 KiB): IRAM
I (477) cpu_start: Pro cpu start user code
I (47) cpu_start: Starting scheduler on PRO CPU.
Traceback (most recent call last):
File "_boot.py", line 10, in <module>
File "inisetup.py", line 28, in setup
File "inisetup.py", line 6, in check_bootsec
File "flashbdev.py", line 13, in readblocks
OSError: [Errno 5] EIO
OSError: [Errno 1] EPERM
OSError: [Errno 1] EPERM
MicroPython v1.9.3-255-g979c688-dirty on 2018-03-21; ESP32 module with ESP32
Type "help()" for more information.
>>>
I used this line to program. I changed the name of the bin somewhat.
D:\Program Files>python python\python36\esptool-master\esptool.py --chip esp32 --port COM6 --baud 460800 write_flash --flash_freq 40m --flash_mode dio --flash_size 2MB -z 0x1000 D:\Tools\uPython\upyeasy-esp32\upyeasy_v021_2048.bin

BertB
Normal user
Posts: 1020
Joined: 25 Apr 2015, 14:39

Re: ESP32 boards

#217 Post by BertB » 24 Mar 2018, 20:26

Now ... maybe of interest ...
When I use this:D:\Program Files>python python\python36\esptool-master\esptool.py --port COM6 write_flash --compress 0x1000 D:\Tools\uPython\upyeasy-esp32\upyeasy_un4096.bin

This is the kind of same command as in the very beginning of this item, page 1

I get this:
ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x3f (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:0x3fff0018,len:4
load:0x3fff001c,len:4416
ho 0 tail 12 room 4
load:0x40078000,len:0
load:0x40078000,len:11816
entry 0x4007a9fc
I (452) cpu_start: Pro cpu up.
I (452) cpu_start: Single core mode
I (452) heap_init: Initializing. RAM available for dynamic allocation:
I (456) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (462) heap_init: At 3FFC4E80 len 0001B180 (108 KiB): DRAM
I (468) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (474) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (481) heap_init: At 4008DE34 len 000121CC (72 KiB): IRAM
I (487) cpu_start: Pro cpu start user code
I (57) cpu_start: Starting scheduler on PRO CPU.
OSError: [Errno 2] ENOENT
MicroPython v1.9.3-473-g22c693a-dirty on 2018-03-22; ESP32 module with ESP32
Type "help()" for more information.
>>>

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

Re: ESP32 boards

#218 Post by AndrewJ » 24 Mar 2018, 20:35

Hi, all,
I tried the 2048 and 4096 binaries from Github (20180321 versions) on my Lolin32 Lite ESP32 board.
The good news: Neither had boot loops.

2048:
Got OSError128 first time (I always get that, it seems my system just doesn't like port 80!). I managed to get in quick to change to port 9000, stable after that.
Set up Domoticz MQTT controller
Connected BME280 sensor and configured in Devices.
Getting data in the Devices main page. (These don't update themselves, but I think that is just the way it is, it's the same in ESPEasy, you have to refresh to
see new values.)
No sign of Async processes running in the log (Domoticz, BME) which I'd expect to see. And no mqtt messages detected in MQTTspy.

4096:
Again, OSError128 at first, fixed by changing port in config page, then stable.
Set up Domoticz MQTT
Configured BME280 in Devices (sensor still connected)
Getting data in Devices page, again need to refresh page to see new values.
Log shows Async processes running (Domoticz, BME, rules/scripts) and show mqtt messages apparently being sent - but can't see any mqtt messages in
MQTTspy.
Connected a DS18B20 sensor and tried to set up in Devices, but on selecting DS18B20 and clicking Submit, the web interface said page not working. Error shown in log, last line in traceback is "onewire.py line 17 in __init__, Attribute error 'NoneType' object has no attribute 'init' ". Despite this, uPyEasy continues to run and process the BME and Domoticz.

Hope this helps!
Andrew

@raptor, I'll try your binary later on.

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

Re: ESP32 boards

#219 Post by LisaM » 24 Mar 2018, 20:41

BertB wrote:
24 Mar 2018, 20:26
Now ... maybe of interest ...
When I use this:D:\Program Files>python python\python36\esptool-master\esptool.py --port COM6 write_flash --compress 0x1000 D:\Tools\uPython\upyeasy-esp32\upyeasy_un4096.bin

This is the kind of same command as in the very beginning of this item, page 1

I get this:
ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x3f (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:0x3fff0018,len:4
load:0x3fff001c,len:4416
ho 0 tail 12 room 4
load:0x40078000,len:0
load:0x40078000,len:11816
entry 0x4007a9fc
I (452) cpu_start: Pro cpu up.
I (452) cpu_start: Single core mode
I (452) heap_init: Initializing. RAM available for dynamic allocation:
I (456) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (462) heap_init: At 3FFC4E80 len 0001B180 (108 KiB): DRAM
I (468) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (474) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (481) heap_init: At 4008DE34 len 000121CC (72 KiB): IRAM
I (487) cpu_start: Pro cpu start user code
I (57) cpu_start: Starting scheduler on PRO CPU.
OSError: [Errno 2] ENOENT
MicroPython v1.9.3-473-g22c693a-dirty on 2018-03-22; ESP32 module with ESP32
Type "help()" for more information.
>>>
So, that means the 2048 is NOT working for you. But the 4096 firmware is! The esptool should not override the flash_size baked in the 4096 firmware, but apparently it does.

If you now do:
>>> import upyeasy
>>> upyeasy.main()
It should start (i hope).

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

Re: ESP32 boards

#220 Post by LisaM » 24 Mar 2018, 20:48

Ok, so use this command to flash the firmware:
esptool.py --port YYYY write_flash --compress 0x1000 xxxx.bin where YYYY is your comport (unix: /dev/ttyUSBx, windows COMx) and xxxx is your firmware name. Don't specify any other parameters as stated earlier in these post in this topic, but follow the first post in the topic.

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

Re: ESP32 boards

#221 Post by AndrewJ » 24 Mar 2018, 22:14

raptor wrote:
24 Mar 2018, 14:54
Hello, guys! You can try my 4096 binary https://drive.google.com/file/d/1p1JFrk ... sp=sharing
It work for my esp-wroom-32 v2 board. If flashing is successful then insert these commands:

Code: Select all

import  upyeasy 
import network
station = network.WLAN(network.STA_IF)
station.active(True)
station.connect("your_ssid", "your_pass")
upyeasy.main()
If there is no errors you should have working board :)
Hello raptor,
Many thanks for posting this. :) I gave it a try on my Lolin32 Lite board, and this is how it went for me....
- I erased flash, then flashed your binary with esptool.py - no problems.
- started the board and put in the commands you recommended - all good, no errors.
- on first run of upyeasy.main() it ended with OSError 128 - this is "normal" for me, for some reason running on port 80 for more than a few seconds doesn't work for me, but i haven't been able to diagnose it. Anyway, corrected by changing port to 9000, then running stable.
- Configured Domoticz MQTT controller and enabled it.
- set hardware for I2C
- Added BME280, working
- Async processes are running as seen in the log (Domoticz, BME) but I'm not seeing mqtt data in MQTTspy.
- Tried to add DS18B20, Got further than with Lisa's version, was able to configure the device and save, but it keeps giving an error "Onewire.py line 22 in reset, Onewire Error: " and data value is wrong (75 degrees in my room! ).

So in summary it's getting there but not yet quite all the way.

Best wishes, Andrew

karl222
Normal user
Posts: 88
Joined: 23 Aug 2017, 17:18
Location: Vienna

Re: ESP32 boards

#222 Post by karl222 » 24 Mar 2018, 22:54

hi,

i have tried on both platforms but was not able to get it running. I have no clue to identify why it doesn't work. Installation of firmware obviously worked but I can't reach it via browser. I am concerned by the last line of the protocol (see below):

ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_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:0x3fff0018,len:4
load:0x3fff001c,len:4416
ho 0 tail 12 room 4
load:0x40078000,len:0
load:0x40078000,len:11816
entry 0x4007a9fc
I (450) cpu_start: Pro cpu up.
I (450) cpu_start: Single core mode
I (450) heap_init: Initializing. RAM available for dynamic allocation:
I (454) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (460) heap_init: At 3FFC4E80 len 0001B180 (108 KiB): DRAM
I (466) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (472) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (479) heap_init: At 4008DE34 len 000121CC (72 KiB): IRAM
I (485) cpu_start: Pro cpu start user code
I (55) cpu_start: Starting scheduler on PRO CPU.
OSError: [Errno 2] ENOENT
MicroPython v1.9.3-473-g22c693a-dirty on 2018-03-22; ESP32 module with ESP32
Type "help()" for more information.
>>> import upyeasy
I (11577) modsocket: Initializing
>>> import network
>>>
>>> station = network.WLAN(network.STA_IF)
I (30677) wifi: wifi firmware version: ebd3e5d
I (30677) wifi: config NVS flash: enabled
I (30677) wifi: config nano formating: disabled
I (30677) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (30687) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (30717) wifi: Init dynamic tx buffer num: 32
I (30717) wifi: Init data frame dynamic rx buffer num: 64
I (30717) wifi: Init management frame dynamic rx buffer num: 64
I (30717) wifi: wifi driver task: 3ffc9780, prio:23, stack:4096
I (30727) wifi: Init static rx buffer num: 10
I (30727) wifi: Init dynamic rx buffer num: 0
I (30727) wifi: wifi power manager task: 0x3ffcfb04 prio: 21 stack: 2560
W (30737) phy_init: failed to load RF calibration data (0x1102), falling back to full calibration
I (30897) phy: phy_version: 383.0, 79a622c, Jan 30 2018, 15:38:06, 0, 2
I (30907) wifi: mode : null
>>> station.active(True)
I (43367) wifi: mode : sta (30:ae:a4:1f:27:94)
I (43367) wifi: STA_START
True
>>> station.connect("xxxxxx", "yyyyyyyyy")
>>> I (77617) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1
I (78177) wifi: state: init -> auth (b0)
I (78187) wifi: state: auth -> assoc (0)
I (78187) wifi: state: assoc -> run (10)
I (78207) wifi: connected with xxxxxx, channel 1
I (78207) network: event 4
I (79157) event: sta ip: 10.0.0.64, mask: 255.255.255.0, gw: 10.0.0.138
I (79157) network: GOT_IP
I (81187) wifi: pm start, type:0


>>> upyeasy.main()
loaded sink log
loaded sink console
loaded sink syslog
2000-01-01T00:02:12.005 [debug] uPyEasy: Init: Init constructor
2000-01-01T00:02:12.005 [debug] uPyEasy: Init: Entering init
2000-01-01 00:02:12 [debug] uPyEasy: Init: Create directory config
2000-01-01 00:02:13 [debug] uPyEasy: Init: Create directory plugins
2000-01-01 00:02:13 [debug] uPyEasy: Init: Create directory protocols
2000-01-01 00:02:13 [debug] uPyEasy: Init: Create directory scripts
2000-01-01 00:02:13 [debug] uPyEasy: Init: Create directory rules
2000-01-01 00:02:13 [debug] uPyEasy: Init: config Table
2000-01-01 00:02:13 [debug] uPyEasy: Init: network Table
2000-01-01 00:02:14 [debug] uPyEasy: Init: protocol Table
2000-01-01 00:02:14 [debug] uPyEasy: Init: controller Table
2000-01-01 00:02:14 [debug] uPyEasy: Init: hardware Table
2000-01-01 00:02:14 [debug] uPyEasy: Init: dxpin Table
2000-01-01 00:02:14 [debug] uPyEasy: Init: dxmap Table
2000-01-01 00:02:14 [debug] uPyEasy: Init: plugin Table
2000-01-01 00:02:15 [debug] uPyEasy: Init: pluginstore Table
2000-01-01 00:02:15 [debug] uPyEasy: Init: device Table
2000-01-01 00:02:15 [debug] uPyEasy: Init: service Table
2000-01-01 00:02:15 [debug] uPyEasy: Init: notification Table
2000-01-01 00:02:15 [debug] uPyEasy: Init: advanced Table
2000-01-01 00:02:15 [debug] uPyEasy: Init: script Table
2000-01-01 00:02:16 [debug] uPyEasy: Init: rule Table
2000-01-01 00:02:16 [debug] uPyEasy: Init: Create Config Record
2000-01-01 00:02:16 [debug] uPyEasy: Init: Create Network Record
2000-01-01 00:02:16 [debug] uPyEasy: Init: Create Hardware Record
2000-01-01 00:02:16 [debug] uPyEasy: Hal: hardwaredb init
2000-01-01 00:02:16 [debug] uPyEasy: Hal: hardwaredb esp32
2000-01-01 00:02:17 [debug] uPyEasy: Init: Create dxpin Record
2000-01-01 00:02:17 [debug] uPyEasy: Hal: dxpins_init
2000-01-01 00:02:17 [debug] uPyEasy: Hal: dxpins_init esp32
2000-01-01 00:02:17 [debug] uPyEasy: Init: Create advanced Record
2000-01-01 00:02:17 [debug] uPyEasy: Hal: Init
2000-01-01 00:02:17 [debug] uPyEasy: Hal: init, network record present
2000-01-01 00:02:18 [debug] uPyEasy: Hal: esp32
2000-01-01 00:02:18 [debug] uPyEasy: Hal: esp32, ssid empty
I (146227) network: event 1
2000-01-01 00:02:20 [debug] uPyEasy: Hal: esp32, Scan: Ssid found: xxxxxx Strength: -79 dBm Security: 4
2000-01-01 00:02:20 [debug] uPyEasy: Hal: esp32, Scan: Ssid found: xxxxxx Strength: -80 dBm Security: 3
2000-01-01 00:02:20 [debug] uPyEasy: Hal: esp32, Scan: Ssid found: xxxxxxGast Strength: -82 dBm Security: 4
2000-01-01 00:02:20 [debug] uPyEasy: Hal: esp32, Scan: Ssid found: A1-1cfeb1 Strength: -92 dBm Security: 3
2000-01-01 00:02:20 [debug] uPyEasy: Protocols: Load
2000-01-01 00:02:20 [debug] uPyEasy: Protocols: Init protocol records
2000-01-01 00:02:20 [debug] uPyEasy: Protocols: Load protocol domoticz_mqtt
2000-01-01 00:02:20 [debug] uPyEasy: Protocols: Create protocol Record: domoticz_mqtt
2000-01-01 00:02:21 [debug] uPyEasy: Protocols: Load protocol domoticz_http
2000-01-01 00:02:21 [debug] uPyEasy: Protocols: Create protocol Record: domoticz_http
2000-01-01 00:02:21 [debug] uPyEasy: Protocols: Init protocol records, run async loop
2000-01-01 00:02:21 [debug] uPyEasy: Plugins: Load
2000-01-01 00:02:21 [debug] uPyEasy: Plugins: init plugin records
2000-01-01 00:02:21 [debug] uPyEasy: Plugins: Register frozen plugin switch
2000-01-01 00:02:21 [debug] uPyEasy: Plugin: switch contruction
2000-01-01 00:02:21 [debug] uPyEasy: Plugins: Create frozen plugin Record: switch
2000-01-01 00:02:21 [debug] uPyEasy: Plugins: Register frozen plugin bme280
2000-01-01 00:02:22 [debug] uPyEasy: Plugins: Create frozen plugin Record: bme280
2000-01-01 00:02:22 [debug] uPyEasy: Plugins: Register frozen plugin test
2000-01-01 00:02:22 [debug] uPyEasy: Plugins: Create frozen plugin Record: test
2000-01-01 00:02:22 [debug] uPyEasy: Plugins: Register frozen plugin ds18
2000-01-01 00:02:22 [debug] uPyEasy: Plugin: ds18 contruction
2000-01-01 00:02:22 [debug] uPyEasy: Plugins: Create frozen plugin Record: ds18
2000-01-01 00:02:22 [debug] uPyEasy: Plugins: Init plugin records, run async loop
2000-01-01 00:02:22 [debug] uPyEasy: Scripts: Load
2000-01-01 00:02:23 [debug] uPyEasy: Scripts: Init
2000-01-01 00:02:23 [debug] uPyEasy: Plugins: GetQueue
2000-01-01 00:02:23 [debug] uPyEasy: Scripts: init scripts records
2000-01-01 00:02:23 [debug] uPyEasy: Scripts: init rules records
2000-01-01 00:02:23 [debug] uPyEasy: Scripts: Init script/rule records, run async loop
2000-01-01 00:02:23 [debug] uPyEasy: Utils: Sys hostname
2000-01-01 00:02:23 [debug] uPyEasy: Utils: uPyEasy Name
Set syslog hostname 0.0.0.0
reloaded sink syslog
2000-01-01 00:02:23 [debug] uPyEasy-uPyEasy: Hal: Entering SetTime
2000-01-01 00:02:23 [debug] uPyEasy-uPyEasy: Hal: Entering GetNtpTime
2000-01-01 00:02:23 [debug] uPyEasy-uPyEasy: Hal: network Table
2000-01-01 00:02:23 [debug] uPyEasy-uPyEasy: Hal: Using NTP Hostname: pool.ntp.org
2000-01-01 00:02:24 [debug] uPyEasy-uPyEasy: Hal: TimeZome offset: 60
2000-01-01 00:02:24 [debug] uPyEasy-uPyEasy: Hal: Received UTC NTP Time: 575243202
2000-01-01 00:02:24 [debug] uPyEasy-uPyEasy: Hal: Timezone corrected NTP Time: 575246802
2000-01-01 00:02:24 [debug] uPyEasy-uPyEasy: Hal: DST corrected NTP Time: 575246802
2000-01-01 00:02:24 [debug] uPyEasy-uPyEasy: Hal: Received NTP Time: 575246802
2000-01-01 00:02:24 [debug] uPyEasy-uPyEasy: Hal: StartTime: 575246802
2018-03-24 22:46:42 [debug] uPyEasy-uPyEasy: Set time: 2018-03-24T22:46:42
Exiting: Network not available, set network values!
>>>

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

Re: ESP32 boards

#223 Post by LisaM » 25 Mar 2018, 01:31

karl222 wrote:
24 Mar 2018, 22:54
hi,

i have tried on both platforms but was not able to get it running. I have no clue to identify why it doesn't work. Installation of firmware obviously worked but I can't reach it via browser. I am concerned by the last line of the protocol (see below):


2000-01-01 00:02:24 [debug] uPyEasy-uPyEasy: Hal: Received NTP Time: 575246802
2000-01-01 00:02:24 [debug] uPyEasy-uPyEasy: Hal: StartTime: 575246802
2018-03-24 22:46:42 [debug] uPyEasy-uPyEasy: Set time: 2018-03-24T22:46:42
Exiting: Network not available, set network values!
>>>
Don't do the import network stuff, uPyEasy has it's own.
Just do:
>>> import upyeasy
>>> upyeasy.main()
...
Exiting: Network not available, set network values!
>>> upyeasy.setwifi('<YOUR_SSID>', '<YOUR_SSID_PW>','', '')
Replace <your_ssid> and <your_ssid_pw> with your own ssid and pw, reboot and it should work.

Just maybe... i should change this in the code (not done yet!):
>>> upyeasy.main()
to this (the first time):
>>> upyeasy.main('<YOUR_SSID>', '<YOUR_SSID_PW>')
Would that be be easier?

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

Re: ESP32 boards

#224 Post by budman1758 » 25 Mar 2018, 05:37

OK. Installed ESP tool on a different computer. (non win 10) Windows 7 ult.
Got pyserial working ok.
Set up a brand new module on a protoboard.
https://www.ebay.com/itm/ESP-WROOM-32-E ... 2749.l2649
https://www.ebay.com/itm/5X7-7X9CM-Prot ... 2749.l2649

Was able to erase flash the first try!
Was able to flash the firmware the first try! Latest ESP32 firmware from the release page on git. Renamed the file to upyeasy-esp32.bin.
Used this command from post 31 in this thread. The command for Windows from post 1 does NOT work.

Code: Select all

esptool.py --port COM5 write_flash 0x1000 upyeasy-esp32.bin --compress 
Was able to start with "import upyeasy" and "upyeasy.main()" on the first try!
Was able to set wifi creds the first try!
Module starts up and after using "import upyeasy" and "upyeasy.main()" each and every time it connects to wifi and web config pages are up and running every time!

Now..... How do I get it to autostart each time?
Tried the Ampy method to upload a main file to autostart. No workie
The tools page that shows the file system shows the file system ok. Edit and upload buttons take me to blank web pages. No workie.
Want to continue testing but don't want to have to manual start each time.
Methinks that if we have easy in the name it should start easily.... Just sayin.... :D
Please show/tell me how to get it to autostart. Once we get there I will start hanging some hardware on it.
Thanks.
"The glass is twice as big as it needs to be".

karl222
Normal user
Posts: 88
Joined: 23 Aug 2017, 17:18
Location: Vienna

Re: ESP32 boards

#225 Post by karl222 » 25 Mar 2018, 10:53

LisaM wrote:
25 Mar 2018, 01:31
karl222 wrote:
24 Mar 2018, 22:54
hi,

i have tried on both platforms but was not able to get it running. I have no clue to identify why it doesn't work. Installation of firmware obviously worked but I can't reach it via browser. I am concerned by the last line of the protocol (see below):


2000-01-01 00:02:24 [debug] uPyEasy-uPyEasy: Hal: Received NTP Time: 575246802
2000-01-01 00:02:24 [debug] uPyEasy-uPyEasy: Hal: StartTime: 575246802
2018-03-24 22:46:42 [debug] uPyEasy-uPyEasy: Set time: 2018-03-24T22:46:42
Exiting: Network not available, set network values!
>>>
Don't do the import network stuff, uPyEasy has it's own.
Just do:
>>> import upyeasy
>>> upyeasy.main()
...
Exiting: Network not available, set network values!
>>> upyeasy.setwifi('<YOUR_SSID>', '<YOUR_SSID_PW>','', '')
Replace <your_ssid> and <your_ssid_pw> with your own ssid and pw, reboot and it should work.

Just maybe... i should change this:
>>> upyeasy.main()
to this (the first time):
>>> upyeasy.main('<YOUR_SSID>', '<YOUR_SSID_PW>')
Would that be be easier?
Hi Lisa,

I tried it your way, left out the network stuff and just went ahead with "Import upyeasy" but it didn't work.

also getting Errors when trying to set wifi credentials wit upyeasy.main(xxxx)

Lisa, are you really sure you've got it up and running on your Hardware :P

Thanks to everyone for being Patient...!

>>> import upyeasy
I (10677) modsocket: Initializing
>>> station = network.WLAN(network.STA_IF)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'network' is not defined
>>> station.active(True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'station' is not defined
>>> import network
>>> station = network.WLAN(network.STA_IF)
I (73137) wifi: wifi firmware version: ebd3e5d
I (73147) wifi: config NVS flash: enabled
I (73147) wifi: config nano formating: disabled
I (73147) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (73157) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (73177) wifi: Init dynamic tx buffer num: 32
I (73177) wifi: Init data frame dynamic rx buffer num: 64
I (73177) wifi: Init management frame dynamic rx buffer num: 64
I (73177) wifi: wifi driver task: 3ffc9780, prio:23, stack:4096
I (73187) wifi: Init static rx buffer num: 10
I (73187) wifi: Init dynamic rx buffer num: 0
I (73197) wifi: wifi power manager task: 0x3ffcfb04 prio: 21 stack: 2560
W (73197) phy_init: failed to load RF calibration data (0x1102), falling back to full calibration
I (73357) phy: phy_version: 383.0, 79a622c, Jan 30 2018, 15:38:06, 0, 2
I (73367) wifi: mode : null
>>> station.active(True)
I (78847) wifi: mode : sta (30:ae:a4:1f:27:94)
I (78847) wifi: STA_START
True
>>> station.connect("xxxxxx", "yyyyyyy")
>>> I (85617) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1
I (86177) wifi: state: init -> auth (b0)
I (86187) wifi: state: auth -> assoc (0)
I (86187) wifi: state: assoc -> run (10)
I (86207) wifi: connected with xxxxxx, channel 1
I (86207) network: event 4
I (86757) event: sta ip: 10.0.0.64, mask: 255.255.255.0, gw: 10.0.0.138
I (86757) network: GOT_IP
I (89187) wifi: pm start, type:0


>>> upyeasy.main('xxxxxx', 'yyyyyy')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: function takes 0 positional arguments but 2 were given
>>> upyeasy.main("xxxxxx", "yyyyyyy")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: function takes 0 positional arguments but 2 were given

BertB
Normal user
Posts: 1020
Joined: 25 Apr 2015, 14:39

Re: ESP32 boards

#226 Post by BertB » 25 Mar 2018, 11:51

LisaM wrote:
24 Mar 2018, 20:48
Ok, so use this command to flash the firmware:
esptool.py --port YYYY write_flash --compress 0x1000 xxxx.bin where YYYY is your comport (unix: /dev/ttyUSBx, windows COMx) and xxxx is your firmware name. Don't specify any other parameters as stated earlier in these post in this topic, but follow the first post in the topic.
Let's go thru this step by step, cause I am loosing it :?

First I do:
D:\Program Files\Python\Python36>python esptool-master\esptool.py --port COM6 erase_flash
esptool.py v2.3-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 4.9s
Hard resetting...

D:\Program Files\Python\Python36>
So far so good:
Then I do:
D:\Program Files\Python\Python36>python esptool-master\esptool.py --port COM6 write_flash --compress 0x1000 D:\Tools\uPython\upyeasy-esp32\upyeasy_v021_20180321_test_esp32_2048.bin
esptool.py v2.3-dev
Connecting........_
Detecting chip type... ESP32
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 1207952 bytes to 698892...
Wrote 1207952 bytes (698892 compressed) at 0x00001000 in 61.6 seconds (effective 156.8 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting...

D:\Program Files\Python\Python36>
Also good.

Then I open a com port session with PuTTY:
It says:
ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x3f (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:0x3fff0018,len:4
load:0x3fff001c,len:4364
load:0x40078000,len:0
load:0x40078000,len:10992
entry 0x4007a6c4
I (442) cpu_start: Pro cpu up.
I (442) cpu_start: Single core mode
I (442) heap_init: Initializing. RAM available for dynamic allocation:
I (446) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (452) heap_init: At 3FFDCDD0 len 00003230 (12 KiB): DRAM
I (458) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (464) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (471) heap_init: At 4009005C len 0000FFA4 (63 KiB): IRAM
I (477) cpu_start: Pro cpu start user code
I (47) cpu_start: Starting scheduler on PRO CPU.
OSError: [Errno 2] ENOENT
MicroPython v1.9.3-255-g979c688-dirty on 2018-03-21; ESP32 module with ESP32
Type "help()" for more information.
>>>
So, I do the follwing steps, according to the first post. I think ...
>>> import upyeasy
I (198213) modsocket: Initializing
>>> upyeasy.main()
loaded sink log
loaded sink console
loaded sink syslog
2000-01-01T00:03:28.005 [debug] uPyEasy: Init: Init constructor
2000-01-01T00:03:28.005 [debug] uPyEasy: Init: Entering init
2000-01-01 00:03:28 [debug] uPyEasy: Init: Create directory config
2000-01-01 00:03:28 [debug] uPyEasy: Init: Create directory plugins
2000-01-01 00:03:28 [debug] uPyEasy: Init: Create directory protocols
2000-01-01 00:03:29 [debug] uPyEasy: Init: Create directory scripts
2000-01-01 00:03:29 [debug] uPyEasy: Init: Create directory rules
2000-01-01 00:03:29 [debug] uPyEasy: Init: config Table
2000-01-01 00:03:29 [debug] uPyEasy: Init: network Table
2000-01-01 00:03:30 [debug] uPyEasy: Init: protocol Table
2000-01-01 00:03:30 [debug] uPyEasy: Init: controller Table
2000-01-01 00:03:30 [debug] uPyEasy: Init: hardware Table
2000-01-01 00:03:30 [debug] uPyEasy: Init: dxpin Table
2000-01-01 00:03:31 [debug] uPyEasy: Init: dxmap Table
2000-01-01 00:03:31 [debug] uPyEasy: Init: plugin Table
2000-01-01 00:03:31 [debug] uPyEasy: Init: pluginstore Table
2000-01-01 00:03:32 [debug] uPyEasy: Init: device Table
2000-01-01 00:03:32 [debug] uPyEasy: Init: service Table
2000-01-01 00:03:32 [debug] uPyEasy: Init: notification Table
2000-01-01 00:03:32 [debug] uPyEasy: Init: advanced Table
2000-01-01 00:03:33 [debug] uPyEasy: Init: script Table
2000-01-01 00:03:33 [debug] uPyEasy: Init: rule Table
2000-01-01 00:03:33 [debug] uPyEasy: Init: Create Config Record
2000-01-01 00:03:34 [debug] uPyEasy: Init: Create Network Record
2000-01-01 00:03:34 [debug] uPyEasy: Init: Create Hardware Record
2000-01-01 00:03:34 [debug] uPyEasy: Hal: hardwaredb init
2000-01-01 00:03:34 [debug] uPyEasy: Hal: hardwaredb esp32
2000-01-01 00:03:34 [debug] uPyEasy: Init: Create dxpin Record
2000-01-01 00:03:35 [debug] uPyEasy: Hal: dxpins_init
2000-01-01 00:03:35 [debug] uPyEasy: Hal: dxpins_init esp32
2000-01-01 00:03:35 [debug] uPyEasy: Init: Create advanced Record
2000-01-01 00:03:36 [debug] uPyEasy: Hal: Init
2000-01-01 00:03:36 [debug] uPyEasy: Hal: init, network record present
2000-01-01 00:03:36 [debug] uPyEasy: Hal: esp32
I (225953) wifi: wifi firmware version: 111e74d
I (225953) wifi: config NVS flash: enabled
I (225953) wifi: config nano formating: disabled
I (225963) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (225973) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (225993) wifi: Init dynamic tx buffer num: 32
I (225993) wifi: Init data frame dynamic rx buffer num: 64
I (225993) wifi: Init management frame dynamic rx buffer num: 64
I (225993) wifi: wifi driver task: 3ffde13c, prio:23, stack:4096
I (226003) wifi: Init static rx buffer num: 10
I (226003) wifi: Init dynamic rx buffer num: 0
I (226013) wifi: Init rx ampdu len mblock:7
I (226013) wifi: Init lldesc rx ampdu entry mblock:4
I (226023) wifi: wifi power manager task: 0x3ffe8734 prio: 21 stack: 2560
W (226023) phy_init: failed to load RF calibration data (0x1102), falling back to full calibration
I (226183) phy: phy_version: 362.0, 61e8d92, Sep 8 2017, 18:48:11, 0, 2
I (226193) wifi: mode : null
I (226193) wifi: mode : sta (30:ae:a4:22:e8:1c)
I (226193) wifi: STA_START
2000-01-01 00:03:36 [debug] uPyEasy: Hal: esp32, ssid empty
I (228633) network: event 1
2000-01-01 00:03:39 [debug] uPyEasy: Hal: esp32, Scan: Ssid found:xxxxxx Strength: -79 dBm Security: 3
2000-01-01 00:03:39 [debug] uPyEasy: Hal: esp32, Scan: Ssid found: xxxxxx Strength: -79 dBm Security: 3
2000-01-01 00:03:39 [debug] uPyEasy: Hal: esp32, Scan: Ssid found:xxxxxxxxx Strength: -88 dBm Security: 5
2000-01-01 00:03:39 [debug] uPyEasy: Hal: esp32, Scan: Ssid found: xxxxxxxx Strength: -88 dBm Security: 5
2000-01-01 00:03:39 [debug] uPyEasy: Hal: esp32, Scan: Ssid found:xxxxxxxxx Strength: -89 dBm Security: 3
2000-01-01 00:03:39 [debug] uPyEasy: Hal: esp32, Scan: Ssid found: xxxxxxxxx Strength: -90 dBm Security: 3
2000-01-01 00:03:39 [debug] uPyEasy: Hal: esp32, Scan: Ssid found: xxxxxxxxxx Strength: -90 dBm Security: 3
2000-01-01 00:03:39 [debug] uPyEasy: Protocols: Load
2000-01-01 00:03:39 [debug] uPyEasy: Protocols: Init protocol records
2000-01-01 00:03:39 [debug] uPyEasy: Protocols: Load protocol domoticz_mqtt
2000-01-01 00:03:39 [debug] uPyEasy: Protocols: Create protocol Record: domoticz_mqtt
2000-01-01 00:03:40 [debug] uPyEasy: Protocols: Load protocol domoticz_http
2000-01-01 00:03:40 [debug] uPyEasy: Protocols: Create protocol Record: domoticz_http
2000-01-01 00:03:40 [debug] uPyEasy: Protocols: Init protocol records, run async loop
2000-01-01 00:03:40 [debug] uPyEasy: Plugins: Load
2000-01-01 00:03:40 [debug] uPyEasy: Plugins: init plugin records
2000-01-01 00:03:40 [debug] uPyEasy: Plugins: Register frozen plugin switch
2000-01-01 00:03:40 [debug] uPyEasy: Plugin: switch contruction
2000-01-01 00:03:40 [debug] uPyEasy: Plugins: Create frozen plugin Record: switch
2000-01-01 00:03:41 [debug] uPyEasy: Plugins: Register frozen plugin bme280
2000-01-01 00:03:41 [debug] uPyEasy: Plugins: Create frozen plugin Record: bme280
2000-01-01 00:03:41 [debug] uPyEasy: Plugins: Register frozen plugin test
2000-01-01 00:03:41 [debug] uPyEasy: Plugins: Create frozen plugin Record: test
2000-01-01 00:03:42 [debug] uPyEasy: Plugins: Register frozen plugin ds18
2000-01-01 00:03:42 [debug] uPyEasy: Plugin: ds18 contruction
2000-01-01 00:03:42 [debug] uPyEasy: Plugins: Create frozen plugin Record: ds18
2000-01-01 00:03:42 [debug] uPyEasy: Plugins: Init plugin records, run async loop
2000-01-01 00:03:42 [debug] uPyEasy: Init: Init devices
2000-01-01 00:03:42 [debug] uPyEasy: Scripts: Load
2000-01-01 00:03:42 [debug] uPyEasy: Scripts: Init
2000-01-01 00:03:42 [debug] uPyEasy: Plugins: GetQueue
2000-01-01 00:03:42 [debug] uPyEasy: Scripts: init scripts records
2000-01-01 00:03:42 [debug] uPyEasy: Scripts: init rules records
2000-01-01 00:03:43 [debug] uPyEasy: Scripts: Init script/rule records, run async loop
2000-01-01 00:03:43 [debug] uPyEasy: Utils: Sys hostname
2000-01-01 00:03:43 [debug] uPyEasy: Utils: uPyEasy Name
Set syslog hostname 0.0.0.0
reloaded sink syslog
2000-01-01 00:03:43 [debug] uPyEasy-uPyEasy: Hal: Entering SetTime
2000-01-01 00:03:43 [debug] uPyEasy-uPyEasy: Hal: Entering GetNtpTime
2000-01-01 00:03:43 [debug] uPyEasy-uPyEasy: Hal: network Table
2000-01-01 00:03:43 [debug] uPyEasy-uPyEasy: Hal: Using NTP Hostname: pool.ntp.org
2000-01-01 00:03:43 [debug] uPyEasy-uPyEasy: Hal: TimeZome offset: 60
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "upyeasy/__init__.py", line 40, in main
File "upyeasy/init.py", line 249, in init
File "upyeasy/hal.py", line 338, in settime
File "upyeasy/hal.py", line 272, in getntptime
File "upyeasy/hal.py", line 264, in getntptime
IndexError: list index out of range
>>>
So, now I think the device is not connected to any network.

So, I enter the setwifi thing:
>>> upyeasy.setwifi('xxxxx','xxxxxxx')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "upyeasy/__init__.py", line 29, in setwifi
File "upyeasy/utils.py", line 46, in setwifi
File "filedb.py", line 73, in update
OSError: [Errno 2] ENOENT
>>>

Don't know what to do now.

Martinus

Re: ESP32 boards

#227 Post by Martinus » 25 Mar 2018, 13:45

I also decided to give uPyEasy a try on one of my ESP32 modules. Using a Wemos Lolin32 Lite module.
Install was quite easy:

Code: Select all

esptool.py --port COM3 erase_flash
esptool.py --port COM3 write_flash --compress 0x1000 upyeasy_v021_20180321_test_esp32_4096.bin
import upyeasy
upyeasy.main()
upyeasy.setwifi('xxx', 'yyy')
I was able to read the connected DS18B20 sensor. So far so good.

But after reboot, it does not start automatically. It is mentioned to put the startup commands in boot.py.
But how? Pressing the edit button in the webgui does nothing.

BertB
Normal user
Posts: 1020
Joined: 25 Apr 2015, 14:39

Re: ESP32 boards

#228 Post by BertB » 25 Mar 2018, 14:23

Happy to see this working, but it is yet another approach of getting started. :?

Martinus

Re: ESP32 boards

#229 Post by Martinus » 25 Mar 2018, 14:24

Figured out how:
created boot.py on desktop, then:

Code: Select all

ampy --port COM3 put boot.py
But there might be an easier way?

Martinus

Re: ESP32 boards

#230 Post by Martinus » 25 Mar 2018, 14:27

BertB wrote:
25 Mar 2018, 14:23
Happy to see this working, but it is yet another approach of getting started. :?
Is it? I just followed instructions from the initial post in this thread.

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

Re: ESP32 boards

#231 Post by LisaM » 25 Mar 2018, 15:15

karl222 wrote:
25 Mar 2018, 10:53
>>> upyeasy.main('xxxxxx', 'yyyyyy')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: function takes 0 positional arguments but 2 were given
>>> upyeasy.main("xxxxxx", "yyyyyyy")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: function takes 0 positional arguments but 2 were given
Hi Karl222,

To fast! I haven't changed this yet. My question was whether this was a good idea or not... ;)
For now you can start upyeasy by using:

Code: Select all

>>> import upyeasy
upyeasy.main()
IF upyeasy comes back with the error:
Exiting: Network not available, set network values!
THEN use this command:

Code: Select all

>>> upyeasy.setwifi('<your ssid>', '<your ssid password>','<your backup ssid, if any>', '<your backup ssid pw>',<your port>)
where <your ssid> and others are to be replaced with your info.

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

Re: ESP32 boards

#232 Post by LisaM » 25 Mar 2018, 15:19

budman1758 wrote:
25 Mar 2018, 05:37
OK. Installed ESP tool on a different computer. (non win 10) Windows 7 ult.
Got pyserial working ok.
Set up a brand new module on a protoboard.
https://www.ebay.com/itm/ESP-WROOM-32-E ... 2749.l2649
https://www.ebay.com/itm/5X7-7X9CM-Prot ... 2749.l2649

Was able to erase flash the first try!
Was able to flash the firmware the first try! Latest ESP32 firmware from the release page on git. Renamed the file to upyeasy-esp32.bin.
Used this command from post 31 in this thread. The command for Windows from post 1 does NOT work.

Code: Select all

esptool.py --port COM5 write_flash 0x1000 upyeasy-esp32.bin --compress 
Was able to start with "import upyeasy" and "upyeasy.main()" on the first try!
Was able to set wifi creds the first try!
Module starts up and after using "import upyeasy" and "upyeasy.main()" each and every time it connects to wifi and web config pages are up and running every time!

Now..... How do I get it to autostart each time?
Tried the Ampy method to upload a main file to autostart. No workie
The tools page that shows the file system shows the file system ok. Edit and upload buttons take me to blank web pages. No workie.
Want to continue testing but don't want to have to manual start each time.
Methinks that if we have easy in the name it should start easily.... Just sayin.... :D
Please show/tell me how to get it to autostart. Once we get there I will start hanging some hardware on it.
Thanks.
It should have created an autostart entry in boot.py, but due to a bug it was ommitted (and fixed currently).
Autostart can be done by adding this:

Code: Select all

import upyeasy
upyeasy.main()
at the end of the file boot.py in the root directory of the ESP32.

For those of you building your own firmware, please change in the ports/esp32/modules directory the file initsetup.py!
From this:

Code: Select all

def setup():
    check_bootsec()
    print("Performing initial setup")
    uos.VfsFat.mkfs(bdev)
    vfs = uos.VfsFat(bdev)
    uos.mount(vfs, '/flash')
    uos.chdir('/flash')
    with open("boot.py", "w") as f:
        f.write("""\
# This file is executed on every boot (including wake-boot from deepsleep)
""")
    return vfs
To this:

Code: Select all

def setup():
    check_bootsec()
    print("Performing initial setup")
    uos.VfsFat.mkfs(bdev)
    vfs = uos.VfsFat(bdev)
    uos.mount(vfs, '/flash')
    uos.chdir('/flash')
    with open("boot.py", "w") as f:
        f.write("""\
# This file is executed on every boot (including wake-boot from deepsleep)
import upyeasy
upyeasy.main()
""")
    return vfs

BertB
Normal user
Posts: 1020
Joined: 25 Apr 2015, 14:39

Re: ESP32 boards

#233 Post by BertB » 25 Mar 2018, 15:29

Seems its running again, with the 4096 bin.
But, it does not pass the data to Domoticz, using HTTP, nor does it auto update once every 60 seconds.
After a manual update (by clicking Devices) I getnew values, as expected and this:
stack: 2032 out of 15360
GC: total: 96000, used: 75856, free: 20144
No. of 1-blocks: 1295, 2-blocks: 154, max blk sz: 902, max free sz: 185
575303220.748 <HTTPRequest object at 3ffbc640> <StreamWriter <socket>> "GET /devices"
2018-03-25 14:27:43 [debug] uPyEasy-uPyEasy: Pages: Authorize User!?
2018-03-25 14:27:43 [debug] uPyEasy-uPyEasy: Pages: Entering Devices Page
2018-03-25 14:27:43 [debug] uPyEasy-uPyEasy: Utils: uPyEasy Name
2018-03-25 14:27:43 [debug] uPyEasy-uPyEasy: Plugins: Read device DS1
2018-03-25 14:27:44 [debug] uPyEasy-uPyEasy: Plugin: ds18 read
2018-03-25 14:27:44 [debug] uPyEasy-uPyEasy: Plugins: Read device BME1
2018-03-25 14:27:44 [debug] uPyEasy-uPyEasy: Plugin: bme280 read
stack: 2032 out of 15360
GC: total: 96000, used: 85072, free: 10928
No. of 1-blocks: 1307, 2-blocks: 158, max blk sz: 902, max free sz: 408
575303316.116 <HTTPRequest object at 3ffbd430> <StreamWriter <socket>> "GET /static/upyeasy.css"
stack: 2032 out of 15360
GC: total: 96000, used: 86624, free: 9376
No. of 1-blocks: 1352, 2-blocks: 165, max blk sz: 902, max free sz: 385
575303316.116 <HTTPRequest object at 3ffc2ed0> <StreamWriter <socket>> "GET /static/upyeasy.js"
static/upyeasy.css
static/upyeasy.js

Martinus

Re: ESP32 boards

#234 Post by Martinus » 25 Mar 2018, 15:33

BertB wrote:
25 Mar 2018, 15:29
Seems its running again, with the 4096 bin.
But, it does not pass the data to Domoticz, using HTTP, nor does it auto update once every 60 seconds.
Noticed same here. DS sensor is working, but no data to Domoticz. Log does not reveal any clue.

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

Re: ESP32 boards

#235 Post by LisaM » 25 Mar 2018, 15:33

BertB wrote:
25 Mar 2018, 11:51
2000-01-01 00:03:43 [debug] uPyEasy-uPyEasy: Hal: Entering SetTime
2000-01-01 00:03:43 [debug] uPyEasy-uPyEasy: Hal: Entering GetNtpTime
2000-01-01 00:03:43 [debug] uPyEasy-uPyEasy: Hal: network Table
2000-01-01 00:03:43 [debug] uPyEasy-uPyEasy: Hal: Using NTP Hostname: pool.ntp.org
2000-01-01 00:03:43 [debug] uPyEasy-uPyEasy: Hal: TimeZome offset: 60
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "upyeasy/__init__.py", line 40, in main
File "upyeasy/init.py", line 249, in init
File "upyeasy/hal.py", line 338, in settime
File "upyeasy/hal.py", line 272, in getntptime
File "upyeasy/hal.py", line 264, in getntptime
IndexError: list index out of range
>>>
So, now I think the device is not connected to any network.

So, I enter the setwifi thing:
>>> upyeasy.setwifi('xxxxx','xxxxxxx')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "upyeasy/__init__.py", line 29, in setwifi
File "upyeasy/utils.py", line 46, in setwifi
File "filedb.py", line 73, in update
OSError: [Errno 2] ENOENT
>>>

Don't know what to do now.
[/quote]
Hi Bert,

Actually everything is now working at your ESP32. But... you seem to have run into a bug (of all things!). Which is good and bad, good because it means finally everything is working at your ESP32, bad because seems to be a bug in there. I'll give it a look and fix it right now. The setwifi error you can ignore, that's another bug also fixed (which doesn't have any impact on setting the wifi parameters).
Just a sec, and i'll fix this bug for you and upload a new firmware version.

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

Re: ESP32 boards

#236 Post by LisaM » 25 Mar 2018, 15:40

BertB wrote:
25 Mar 2018, 15:29
Seems its running again, with the 4096 bin.
But, it does not pass the data to Domoticz, using HTTP, nor does it auto update once every 60 seconds.
After a manual update (by clicking Devices) I getnew values, as expected and this:
stack: 2032 out of 15360
GC: total: 96000, used: 75856, free: 20144
No. of 1-blocks: 1295, 2-blocks: 154, max blk sz: 902, max free sz: 185
575303220.748 <HTTPRequest object at 3ffbc640> <StreamWriter <socket>> "GET /devices"
2018-03-25 14:27:43 [debug] uPyEasy-uPyEasy: Pages: Authorize User!?
2018-03-25 14:27:43 [debug] uPyEasy-uPyEasy: Pages: Entering Devices Page
2018-03-25 14:27:43 [debug] uPyEasy-uPyEasy: Utils: uPyEasy Name
2018-03-25 14:27:43 [debug] uPyEasy-uPyEasy: Plugins: Read device DS1
2018-03-25 14:27:44 [debug] uPyEasy-uPyEasy: Plugin: ds18 read
2018-03-25 14:27:44 [debug] uPyEasy-uPyEasy: Plugins: Read device BME1
2018-03-25 14:27:44 [debug] uPyEasy-uPyEasy: Plugin: bme280 read
stack: 2032 out of 15360
GC: total: 96000, used: 85072, free: 10928
No. of 1-blocks: 1307, 2-blocks: 158, max blk sz: 902, max free sz: 408
575303316.116 <HTTPRequest object at 3ffbd430> <StreamWriter <socket>> "GET /static/upyeasy.css"
stack: 2032 out of 15360
GC: total: 96000, used: 86624, free: 9376
No. of 1-blocks: 1352, 2-blocks: 165, max blk sz: 902, max free sz: 385
575303316.116 <HTTPRequest object at 3ffc2ed0> <StreamWriter <socket>> "GET /static/upyeasy.js"
static/upyeasy.css
static/upyeasy.js
So it's running (you can connect to the upyeasy webserver) but no updates are send to domoticz? Neither using http or mqtt?

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

Re: ESP32 boards

#237 Post by LisaM » 25 Mar 2018, 15:41

Martinus wrote:
25 Mar 2018, 15:33
BertB wrote:
25 Mar 2018, 15:29
Seems its running again, with the 4096 bin.
But, it does not pass the data to Domoticz, using HTTP, nor does it auto update once every 60 seconds.
Noticed same here. DS sensor is working, but no data to Domoticz. Log does not reveal any clue.
Can you post the tail of your log? Let's say 20 lines?

Martinus

Re: ESP32 boards

#238 Post by Martinus » 25 Mar 2018, 15:44

LisaM wrote:
25 Mar 2018, 15:41
Martinus wrote:
25 Mar 2018, 15:33
BertB wrote:
25 Mar 2018, 15:29
Seems its running again, with the 4096 bin.
But, it does not pass the data to Domoticz, using HTTP, nor does it auto update once every 60 seconds.
Noticed same here. DS sensor is working, but no data to Domoticz. Log does not reveal any clue.
Can you post the tail of your log? Let's say 20 lines?
The web log only shows this:

Code: Select all

2018-03-25 14:34:04 [debug] uPyEasy-uPyEasy: Utils: uPyEasy Name
2018-03-25 14:34:14 [debug] uPyEasy-uPyEasy: Pages: Authorize User!?
2018-03-25 14:34:14 [debug] uPyEasy-uPyEasy: Pages: Entering Devices Page
2018-03-25 14:34:14 [debug] uPyEasy-uPyEasy: Utils: uPyEasy Name
2018-03-25 14:34:14 [debug] uPyEasy-uPyEasy: Plugins: Read device test
2018-03-25 14:34:15 [debug] uPyEasy-uPyEasy: Plugin: ds18 read
2018-03-25 14:34:16 [debug] uPyEasy-uPyEasy: Plugins: Read device demo
2018-03-25 14:34:16 [debug] uPyEasy-uPyEasy: Plugin: switch read
2018-03-25 14:34:20 [debug] uPyEasy-uPyEasy: Pages: Authorize User!?
2018-03-25 14:34:20 [debug] uPyEasy-uPyEasy: Pages: Entering Advanced Page
2018-03-25 14:34:20 [debug] uPyEasy-uPyEasy: Pages: Display Advanced Page
2018-03-25 14:34:20 [debug] uPyEasy-uPyEasy: Utils: uPyEasy Name
2018-03-25 14:42:59 [debug] uPyEasy-uPyEasy: Pages: Authorize User!?
2018-03-25 14:43:00 [debug] uPyEasy-uPyEasy: Pages: Display Rules Page
2018-03-25 14:43:00 [debug] uPyEasy-uPyEasy: Utils: uPyEasy Name
2018-03-25 14:43:02 [debug] uPyEasy-uPyEasy: Pages: Authorize User!?
2018-03-25 14:43:03 [debug] uPyEasy-uPyEasy: Pages: Entering Tools Page
2018-03-25 14:43:03 [debug] uPyEasy-uPyEasy: 
2018-03-25 14:43:03 [debug] uPyEasy-uPyEasy: Pages: Display Tools Page
2018-03-25 14:43:03 [debug] uPyEasy-uPyEasy: Utils: uPyEasy Name
2018-03-25 14:43:05 [debug] uPyEasy-uPyEasy: Pages: Authorize User!?
2018-03-25 14:43:06 [debug] uPyEasy-uPyEasy: Pages: Entering Tools Page
2018-03-25 14:43:06 [debug] uPyEasy-uPyEasy: ucmd
2018-03-25 14:43:06 [debug] uPyEasy-uPyEasy: Pages: cmd: log
2018-03-25 14:43:06 [debug] uPyEasy-uPyEasy: Pages: Log command given
2018-03-25 14:43:06 [debug] uPyEasy-uPyEasy: Utils: uPyEasy Name
close

Martinus

Re: ESP32 boards

#239 Post by Martinus » 25 Mar 2018, 15:51

Config:
uPyEasy_Dallas.png
uPyEasy_Dallas.png (68.61 KiB) Viewed 10558 times

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

Re: ESP32 boards

#240 Post by LisaM » 25 Mar 2018, 16:14

Martinus wrote:
25 Mar 2018, 14:24
Figured out how:
created boot.py on desktop, then:

Code: Select all

ampy --port COM3 put boot.py
But there might be an easier way?
PLEASE note that due to an header bug the file edit only works with the firmware release 20180325 and higher (put in the releases section a few minutes ago)
when flashing,the filesystem with your config files will not be deleted, so no need to redo config!

The easy way:
Select tools menu, filessystem/files:
boot.JPG
boot.JPG (86.38 KiB) Viewed 10554 times
klik on boot.py's edit button:
boot2.JPG
boot2.JPG (56.55 KiB) Viewed 10554 times
Add the two lines into the text field:
boot3.JPG
boot3.JPG (63.03 KiB) Viewed 10554 times
Click on the submit button:
boot4.JPG
boot4.JPG (69.46 KiB) Viewed 10554 times
done!

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

Re: ESP32 boards

#241 Post by LisaM » 25 Mar 2018, 16:30

Martinus wrote:
25 Mar 2018, 15:44
LisaM wrote:
25 Mar 2018, 15:41
Martinus wrote:
25 Mar 2018, 15:33

Noticed same here. DS sensor is working, but no data to Domoticz. Log does not reveal any clue.
Can you post the tail of your log? Let's say 20 lines?
The web log only shows this:

Code: Select all

2018-03-25 14:34:04 [debug] uPyEasy-uPyEasy: Utils: uPyEasy Name
2018-03-25 14:34:14 [debug] uPyEasy-uPyEasy: Pages: Authorize User!?
2018-03-25 14:34:14 [debug] uPyEasy-uPyEasy: Pages: Entering Devices Page
2018-03-25 14:34:14 [debug] uPyEasy-uPyEasy: Utils: uPyEasy Name
2018-03-25 14:34:14 [debug] uPyEasy-uPyEasy: Plugins: Read device test
2018-03-25 14:34:15 [debug] uPyEasy-uPyEasy: Plugin: ds18 read
2018-03-25 14:34:16 [debug] uPyEasy-uPyEasy: Plugins: Read device demo
2018-03-25 14:34:16 [debug] uPyEasy-uPyEasy: Plugin: switch read
2018-03-25 14:34:20 [debug] uPyEasy-uPyEasy: Pages: Authorize User!?
2018-03-25 14:34:20 [debug] uPyEasy-uPyEasy: Pages: Entering Advanced Page
2018-03-25 14:34:20 [debug] uPyEasy-uPyEasy: Pages: Display Advanced Page
2018-03-25 14:34:20 [debug] uPyEasy-uPyEasy: Utils: uPyEasy Name
2018-03-25 14:42:59 [debug] uPyEasy-uPyEasy: Pages: Authorize User!?
2018-03-25 14:43:00 [debug] uPyEasy-uPyEasy: Pages: Display Rules Page
2018-03-25 14:43:00 [debug] uPyEasy-uPyEasy: Utils: uPyEasy Name
2018-03-25 14:43:02 [debug] uPyEasy-uPyEasy: Pages: Authorize User!?
2018-03-25 14:43:03 [debug] uPyEasy-uPyEasy: Pages: Entering Tools Page
2018-03-25 14:43:03 [debug] uPyEasy-uPyEasy: 
2018-03-25 14:43:03 [debug] uPyEasy-uPyEasy: Pages: Display Tools Page
2018-03-25 14:43:03 [debug] uPyEasy-uPyEasy: Utils: uPyEasy Name
2018-03-25 14:43:05 [debug] uPyEasy-uPyEasy: Pages: Authorize User!?
2018-03-25 14:43:06 [debug] uPyEasy-uPyEasy: Pages: Entering Tools Page
2018-03-25 14:43:06 [debug] uPyEasy-uPyEasy: ucmd
2018-03-25 14:43:06 [debug] uPyEasy-uPyEasy: Pages: cmd: log
2018-03-25 14:43:06 [debug] uPyEasy-uPyEasy: Pages: Log command given
2018-03-25 14:43:06 [debug] uPyEasy-uPyEasy: Utils: uPyEasy Name
close
I have the same thing, the asyncio timing is NOT kicking off. Searching for the cause!

UPDATE 1: It is working on linux, there a sensor is read and kicked to domoticz every 10 seconds. Investigating why it doesn't work on a ESP32...

Code: Select all

2018-03-25 17:14:53 [debug] uPyEasy-Ubuntu: Plugin: test process
2018-03-25 17:14:53 [debug] uPyEasy-Ubuntu: Plugins: Scheduling Async processing plugin: Test
2018-03-25 17:14:54 [debug] uPyEasy-Ubuntu: Protocol Domoticz HTTP
2018-03-25 17:14:54 [debug] uPyEasy-Ubuntu: Protocol Domoticz HTTP: send SENSOR_TYPE_SWITCH
2018-03-25 17:14:54 [debug] uPyEasy-Ubuntu: Protocol Domoticz HTTP: SENSOR_TYPE_SWITCH
2018-03-25 17:14:54 [debug] uPyEasy-Ubuntu: Protocol Domoticz HTTP message: http://192.168.178.115:8000/json.htm?type=command&param=switchlight&idx=1245&switchcmd=On
2018-03-25 17:14:54 [debug] uPyEasy-Ubuntu: Protocol Domoticz HTTP response: {
   "status" : "OK",
   "title" : "SwitchLight"
}

Martinus

Re: ESP32 boards

#242 Post by Martinus » 25 Mar 2018, 16:37

Just did a fresh install of the latest firmware. Now it automatically connects to my neighbors Wifi printer (!).
It does not seem to listen to serial input. How to get it connect to my network again?

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

Re: ESP32 boards

#243 Post by LisaM » 25 Mar 2018, 16:47

Martinus wrote:
25 Mar 2018, 16:37
Just did a fresh install of the latest firmware. Now it automatically connects to my neighbors Wifi printer (!).
It does not seem to listen to serial input. How to get it connect to my network again?
Oops, :oops: , that's because in absence of the network config uPyEasy connects to the strongest open wifi network.
Just do a crtl-c so you end up on the REPL interface ( the '>>>') and do the setwifi command again. Reboot after that.

uPyEasy connects to the strongest open wifi network as part of an experiment i was conducting: if you make an open wifi network on your phone, uPyEasy connects to that one. Maybe that would make first time config easier.

Martinus

Re: ESP32 boards

#244 Post by Martinus » 25 Mar 2018, 17:15

Ok, i fixed it using crtl-c to get into repl again.

But wouldn't it be easier to launch an AP if no SSID is set, like we do with ESPEasy?

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

Re: ESP32 boards

#245 Post by LisaM » 25 Mar 2018, 17:17

Martinus wrote:
25 Mar 2018, 17:15
Ok, i fixed it using crtl-c to get into repl again.

But wouldn't it be easier to launch an AP if no SSID is set, like we do with ESPEasy?
In hindsight, that might very well be the case... :)

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

Re: ESP32 boards

#246 Post by LisaM » 25 Mar 2018, 17:23

LisaM wrote:
25 Mar 2018, 16:30
Martinus wrote:
25 Mar 2018, 15:44
LisaM wrote:
25 Mar 2018, 15:41

Can you post the tail of your log? Let's say 20 lines?
The web log only shows this:

Code: Select all

2018-03-25 14:34:04 [debug] uPyEasy-uPyEasy: Utils: uPyEasy Name
2018-03-25 14:34:14 [debug] uPyEasy-uPyEasy: Pages: Authorize User!?
2018-03-25 14:34:14 [debug] uPyEasy-uPyEasy: Pages: Entering Devices Page
2018-03-25 14:34:14 [debug] uPyEasy-uPyEasy: Utils: uPyEasy Name
2018-03-25 14:34:14 [debug] uPyEasy-uPyEasy: Plugins: Read device test
2018-03-25 14:34:15 [debug] uPyEasy-uPyEasy: Plugin: ds18 read
2018-03-25 14:34:16 [debug] uPyEasy-uPyEasy: Plugins: Read device demo
2018-03-25 14:34:16 [debug] uPyEasy-uPyEasy: Plugin: switch read
2018-03-25 14:34:20 [debug] uPyEasy-uPyEasy: Pages: Authorize User!?
2018-03-25 14:34:20 [debug] uPyEasy-uPyEasy: Pages: Entering Advanced Page
2018-03-25 14:34:20 [debug] uPyEasy-uPyEasy: Pages: Display Advanced Page
2018-03-25 14:34:20 [debug] uPyEasy-uPyEasy: Utils: uPyEasy Name
2018-03-25 14:42:59 [debug] uPyEasy-uPyEasy: Pages: Authorize User!?
2018-03-25 14:43:00 [debug] uPyEasy-uPyEasy: Pages: Display Rules Page
2018-03-25 14:43:00 [debug] uPyEasy-uPyEasy: Utils: uPyEasy Name
2018-03-25 14:43:02 [debug] uPyEasy-uPyEasy: Pages: Authorize User!?
2018-03-25 14:43:03 [debug] uPyEasy-uPyEasy: Pages: Entering Tools Page
2018-03-25 14:43:03 [debug] uPyEasy-uPyEasy: 
2018-03-25 14:43:03 [debug] uPyEasy-uPyEasy: Pages: Display Tools Page
2018-03-25 14:43:03 [debug] uPyEasy-uPyEasy: Utils: uPyEasy Name
2018-03-25 14:43:05 [debug] uPyEasy-uPyEasy: Pages: Authorize User!?
2018-03-25 14:43:06 [debug] uPyEasy-uPyEasy: Pages: Entering Tools Page
2018-03-25 14:43:06 [debug] uPyEasy-uPyEasy: ucmd
2018-03-25 14:43:06 [debug] uPyEasy-uPyEasy: Pages: cmd: log
2018-03-25 14:43:06 [debug] uPyEasy-uPyEasy: Pages: Log command given
2018-03-25 14:43:06 [debug] uPyEasy-uPyEasy: Utils: uPyEasy Name
close
I have the same thing, the asyncio timing is NOT kicking off. Searching for the cause!

UPDATE 1: It is working on linux, there a sensor is read and kicked to domoticz every 10 seconds. Investigating why it doesn't work on a ESP32...

Code: Select all

2018-03-25 17:14:53 [debug] uPyEasy-Ubuntu: Plugin: test process
2018-03-25 17:14:53 [debug] uPyEasy-Ubuntu: Plugins: Scheduling Async processing plugin: Test
2018-03-25 17:14:54 [debug] uPyEasy-Ubuntu: Protocol Domoticz HTTP
2018-03-25 17:14:54 [debug] uPyEasy-Ubuntu: Protocol Domoticz HTTP: send SENSOR_TYPE_SWITCH
2018-03-25 17:14:54 [debug] uPyEasy-Ubuntu: Protocol Domoticz HTTP: SENSOR_TYPE_SWITCH
2018-03-25 17:14:54 [debug] uPyEasy-Ubuntu: Protocol Domoticz HTTP message: http://192.168.178.115:8000/json.htm?type=command&param=switchlight&idx=1245&switchcmd=On
2018-03-25 17:14:54 [debug] uPyEasy-Ubuntu: Protocol Domoticz HTTP response: {
   "status" : "OK",
   "title" : "SwitchLight"
}
UPDATE2: I suspect this has something to do with the problem:

Code: Select all

2000-01-01 00:00:16 [debug] uPyEasy-ESP32-DOIT: Hal: StartTime: 575307160
2018-03-25 15:32:40 [debug] uPyEasy-ESP32-DOIT: Set time: 2018-03-25T15:32:40
The async loops for plugins and protocols are scheduled to start one seconds later then 2000-01-01, but... due to the ntp time switch this moment never materilizes because the main async loop is started later then that moment. Testing if this is true.

UPDATE3: Nope, didn't work.... :cry:

BertB
Normal user
Posts: 1020
Joined: 25 Apr 2015, 14:39

Re: ESP32 boards

#247 Post by BertB » 25 Mar 2018, 18:34

What version is uploaded last? What time was that?
Just installed a version, say 10 minutes back.
It had the boot.py stuff on board :-)

First created a BME280. That went fine.
Then I wanted to create a DS18B20 and, right after the submit the browser told me that the connection got re inititialized.
stack: 2032 out of 15360
GC: total: 96000, used: 73984, free: 22016
No. of 1-blocks: 1253, 2-blocks: 153, max blk sz: 902, max free sz: 128
575313997.268 <HTTPRequest object at 3ffba410> <StreamWriter <socket>> "GET /dev ice_setting?id=0"
2018-03-25 17:26:39 [debug] uPyEasy-uPyEasy: Pages: Authorize User!?
2018-03-25 17:26:39 [debug] uPyEasy-uPyEasy: Pages: Entering Device Settings Pag e
2018-03-25 17:26:40 [debug] uPyEasy-uPyEasy: Pages: GET
2018-03-25 17:26:40 [debug] uPyEasy-uPyEasy: id
2018-03-25 17:26:40 [debug] uPyEasy-uPyEasy: 0
2018-03-25 17:26:40 [debug] uPyEasy-uPyEasy: Pages: id: 0
2018-03-25 17:26:40 [debug] uPyEasy-uPyEasy: Pages: New Device, choose plugin
2018-03-25 17:26:40 [debug] uPyEasy-uPyEasy: Utils: uPyEasy Name
stack: 2032 out of 15360
GC: total: 96000, used: 80368, free: 15632
No. of 1-blocks: 1297, 2-blocks: 162, max blk sz: 902, max free sz: 238
575313997.268 <HTTPRequest object at 3ffc0d50> <StreamWriter <socket>> "GET /sta tic/upyeasy.css"
stack: 2032 out of 15360
GC: total: 96000, used: 81920, free: 14080
No. of 1-blocks: 1342, 2-blocks: 169, max blk sz: 902, max free sz: 238
575313997.268 <HTTPRequest object at 3ffc4e00> <StreamWriter <socket>> "GET /sta tic/upyeasy.js"
static/upyeasy.css
static/upyeasy.js
stack: 2032 out of 15360
GC: total: 96000, used: 92864, free: 3136
No. of 1-blocks: 1520, 2-blocks: 191, max blk sz: 902, max free sz: 195
575313997.268 <HTTPRequest object at 3ffc9ca0> <StreamWriter <socket>> "POST /de vice_setting?id=0"
2018-03-25 17:26:47 [debug] uPyEasy-uPyEasy: Pages: Authorize User!?
2018-03-25 17:26:47 [debug] uPyEasy-uPyEasy: Pages: Entering Device Settings Pag e
2018-03-25 17:26:47 [debug] uPyEasy-uPyEasy: Pages: POST
2018-03-25 17:26:47 [debug] uPyEasy-uPyEasy: id
2018-03-25 17:26:47 [debug] uPyEasy-uPyEasy: 0
2018-03-25 17:26:47 [debug] uPyEasy-uPyEasy: New Plugin: 4
2018-03-25 17:26:47 [debug] uPyEasy-uPyEasy: Pages: Create Device
2018-03-25 17:26:47 [debug] uPyEasy-uPyEasy: Pages: New Device and plugin choose n: 4
2018-03-25 17:26:48 [debug] uPyEasy-uPyEasy: Utils: uPyEasy Name
2018-03-25 17:26:49 [debug] uPyEasy-uPyEasy: Plugins: Init device: dummy with pl ugin: 4
2018-03-25 17:26:49 [debug] uPyEasy-uPyEasy: Protocols: GetQueue controller 192. 168.0.243-Domoticz HTTP-1
2018-03-25 17:26:49 [debug] uPyEasy-uPyEasy: Plugin: ds18 contruction
2018-03-25 17:26:49 [debug] uPyEasy-uPyEasy: Plugin: ds18 contruction
2018-03-25 17:26:49 [debug] uPyEasy-uPyEasy: Plugins: Init device: dummy ,instan tiate plugin: DS18B20
2018-03-25 17:26:49 [debug] uPyEasy-uPyEasy: Utils: uPyEasy Name
2018-03-25 17:26:50 [debug] uPyEasy-uPyEasy: Plugin: ds18 init
2018-03-25 17:26:50 [debug] uPyEasy-uPyEasy: Plugins: Read device store: dummy
2018-03-25 17:26:50 [debug] uPyEasy-uPyEasy: Plugin: ds18 init, pin used:
2018-03-25 17:26:50 [debug] uPyEasy-uPyEasy: Hal: pin =
575313997.268 <HTTPRequest object at 3ffc9ca0> <StreamWriter <socket>> Attribute Error("'NoneType' object has no attribute 'init'",)
Traceback (most recent call last):
File "picoweb/__init__.py", line 186, in _handle
File "upyeasy/pages.py", line 1249, in devicesettingpage
File "upyeasy/plugin.py", line 118, in initdevice
File "upyeasy/plugins/ds18.py", line 88, in init
File "onewire.py", line 17, in __init__
AttributeError: 'NoneType' object has no attribute 'init'
After reboot (reset button) the browser continued in the DS18B20 config page and I could complete the setup.

karl222
Normal user
Posts: 88
Joined: 23 Aug 2017, 17:18
Location: Vienna

Re: ESP32 boards

#248 Post by karl222 » 25 Mar 2018, 20:28

Can you pls post your steps to success ;)

BertB
Normal user
Posts: 1020
Joined: 25 Apr 2015, 14:39

Re: ESP32 boards

#249 Post by BertB » 25 Mar 2018, 21:41

What can I say. It looks good, but there are no updates.
Probable has something to do with beta testing ;-)

karl222
Normal user
Posts: 88
Joined: 23 Aug 2017, 17:18
Location: Vienna

Re: ESP32 boards

#250 Post by karl222 » 25 Mar 2018, 21:48

Yeah, I have a running esp32!!!!! :D :D :D
Here are the steps that got my esp32 up and running:

press RST button before plugging in usb
Cmd window:
esptool.py --port COM4 erase_flash

esp32>esptool.py --port COM4 write_flash --compress 0x1000 upyeasy_v021_20180325_test_esp32_4096.bin

putty:
import upyeasy
upyeasy.main()
upyeasy.setwifi('xxx', 'yyy')

Thanks to all and Special thanks to Lisa!!!!!!

regards
Karl

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests