ESP32 boards

Moderators: Voyager, BertB, grovkillen, Stuntteam, LisaM

Message
Author
karl222
Normal user
Posts: 90
Joined: 23 Aug 2017, 17:18
Location: Vienna

Re: ESP32 boards

#171 Post by karl222 » 20 Mar 2018, 20:56


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

Re: ESP32 boards

#172 Post by karl222 » 20 Mar 2018, 21:06

Breakthrough!

googling here and googling there... you have to press the boot button before you plug the esp32 in to usb and Keep it pressed. then start Flash sequence and tataaaaa, flashing runs through easily

E:\esp32>esptool.py --chip esp32 --port COM7 --baud 115200 write_flash --flash_freq 40m --flash_mode dio -z 0x1000 upyeasy_v021_20180218_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...
Configuring flash size...
Auto-detected Flash size: 4MB
Flash params set to 0x0220
Compressed 1146384 bytes to 688849...
Wrote 1146384 bytes (688849 compressed) at 0x00001000 in 64.9 seconds (effective 141.3 kbit/s)...
Hash of data verified.

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

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

Re: ESP32 boards

#173 Post by karl222 » 20 Mar 2018, 21:07

aaaaargh, bootloop.... damn!

rst:0x10 (RTCWDT_RTC_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:0x3f400020,len:429240
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_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:0x3f400020,len:429240
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_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:0x3f400020,len:429240

same problem with the 4MB version....

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

Re: ESP32 boards

#174 Post by AndrewJ » 20 Mar 2018, 22:44

karl222 wrote: 20 Mar 2018, 20:56 I've got this module now:

https://www.ebay.de/itm/TTGO-ESP32-WROV ... 2749.l2649
That looks similar to one I have just ordered, but mine is from AlliExpress. I'll be interested to see how yours goes!
Andrew

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

Re: ESP32 boards

#175 Post by karl222 » 20 Mar 2018, 22:47

it does not go, thats the problem :roll:

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

Re: ESP32 boards

#176 Post by AndrewJ » 20 Mar 2018, 22:49

karl222 wrote: 20 Mar 2018, 22:47 it does not go, thats the problem :roll:
Ah, sorry, didn't realise that was the same board with the problem.
Oh well, it may be a wasted purchase! Let's hope we can find a solution.

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

Re: ESP32 boards

#177 Post by LisaM » 21 Mar 2018, 20:00

karl222 wrote: 20 Mar 2018, 22:47 it does not go, thats the problem :roll:
Found it!
It's a building firmware bug, fixed it!
I've uploaded two new versions into the https://github.com/letscontrolit/uPyEas ... s/tag/BETA section, can you download the 4096 version and try it again? If it doesn't work, you can try the 2048 version.

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_4096.bin

Cheers,

Lisa

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

Re: ESP32 boards

#178 Post by raptor » 21 Mar 2018, 21:14

Hi, karl222! I was able to build and deploy firmware following the instructions. I've little problems, but now seems ok.
You can see my post here: http://www.letscontrolit.com/forum/view ... =23&t=3903

I hope this my post helps you.

Regards :)
Regards from Bulgaria.
raptor

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

Re: ESP32 boards

#179 Post by LisaM » 21 Mar 2018, 21:27

Hi, see my changed remark above:

Code: Select all

It's a building firmware bug, fixed it!
I've uploaded two new versions into the https://github.com/letscontrolit/uPyEas ... s/tag/BETA section, can you download the 4096 version and try it again? If it doesn't work, you can try the 2048 version.

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_4096.bin
Cheers,

Lisa

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

Re: ESP32 boards

#180 Post by LisaM » 21 Mar 2018, 21:29

raptor wrote: 21 Mar 2018, 21:14 Hi, karl222! I was able to build and deploy firmware following the instructions. I've little problems, but now seems ok.
You can see my post here: http://www.letscontrolit.com/forum/view ... =23&t=3903

I hope this my post helps you.

Regards :)
The build & deploy doesn't change, it's only my 'how to get the damn binary to github script which was pulling the wrong binary...' :shock:
Ps. i'm happy the guide worked for you!

Cheers,

Lisa

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

Re: ESP32 boards

#181 Post by raptor » 21 Mar 2018, 21:49

You are right, Lisa - build & deploy doesn't change. The problem must by in his custom makefile which overrides some variables from Makefile.
Regards from Bulgaria.
raptor

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

Re: ESP32 boards

#182 Post by LisaM » 21 Mar 2018, 21:54

raptor wrote: 21 Mar 2018, 21:49 You are right, Lisa - build & deploy doesn't change. The problem must by in his custom makefile which overrides some variables from Makefile.
No, it's my fault. The new binaries in the https://github.com/letscontrolit/uPyEasy/releases section should not have this reboot problem.

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

Re: ESP32 boards

#183 Post by BertB » 21 Mar 2018, 22:15

It is not looping anymore.
But now I get this:
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:4364
load:0x40078000,len:0
load:0x40078000,len:10992
entry 0x4007a6c4
W (65) rtc_clk: Potentially bogus XTAL frequency: 35 MHz, guessing 40 MHz
I (447) cpu_start: Pro cpu up.
I (447) cpu_start: Single core mode
I (448) heap_init: Initializing. RAM available for dynamic allocation:
I (451) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (457) heap_init: At 3FFDCDD0 len 00003230 (12 KiB): DRAM
I (463) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (470) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (476) heap_init: At 4009005C len 0000FFA4 (63 KiB): IRAM
I (482) cpu_start: Pro cpu start user code
I (53) 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.
>>> import upyeasy
I (21537) modsocket: Initializing
>>> upyeasy.setwifi('xxxxxxxxxx', 'xxxxxxxx')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "upyeasy/__init__.py", line 29, in setwifi
File "upyeasy/utils.py", line 39, in setwifi
File "upyeasy/db.py", line 87, in getrow
File "filedb.py", line 91, in get
OSError: [Errno 19] ENODEV
>>>

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

Re: ESP32 boards

#184 Post by LisaM » 21 Mar 2018, 22:32

BertB wrote: 21 Mar 2018, 22:15 It is not looping anymore.
But now I get this:
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:4364
load:0x40078000,len:0
load:0x40078000,len:10992
entry 0x4007a6c4
W (65) rtc_clk: Potentially bogus XTAL frequency: 35 MHz, guessing 40 MHz
I (447) cpu_start: Pro cpu up.
I (447) cpu_start: Single core mode
I (448) heap_init: Initializing. RAM available for dynamic allocation:
I (451) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (457) heap_init: At 3FFDCDD0 len 00003230 (12 KiB): DRAM
I (463) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (470) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (476) heap_init: At 4009005C len 0000FFA4 (63 KiB): IRAM
I (482) cpu_start: Pro cpu start user code
I (53) 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.
>>> import upyeasy
I (21537) modsocket: Initializing
>>> upyeasy.setwifi('xxxxxx', 'xxxxxxxxxxxJ')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "upyeasy/__init__.py", line 29, in setwifi
File "upyeasy/utils.py", line 39, in setwifi
File "upyeasy/db.py", line 87, in getrow
File "filedb.py", line 91, in get
OSError: [Errno 19] ENODEV
>>>
Bert, your wifi password is in there...

Did you use the 4096 or 2048 version?
If you used the 4096 version, can you also try using the 2048 version? It sounds like a flash drive error to me.

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

Re: ESP32 boards

#185 Post by BertB » 21 Mar 2018, 22:35

I am getting tired ... thanks.
Ehm, I tried both.

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

Re: ESP32 boards

#186 Post by BertB » 21 Mar 2018, 22:38

It is also impossible to use ampy to upload main.py
D:\Program Files\Python\Python36>ampy --port COM6 put D:\Tools\uPython\main.py
Traceback (most recent call last):
File "d:\program files\python\python36\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "d:\program files\python\python36\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:\Program Files\Python\Python36\Scripts\ampy.exe\__main__.py", line 9, in <module>
File "d:\program files\python\python36\lib\site-packages\click\core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "d:\program files\python\python36\lib\site-packages\click\core.py", line 697, in main
rv = self.invoke(ctx)
File "d:\program files\python\python36\lib\site-packages\click\core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "d:\program files\python\python36\lib\site-packages\click\core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "d:\program files\python\python36\lib\site-packages\click\core.py", line 535, in invoke
return callback(*args, **kwargs)
File "d:\program files\python\python36\lib\site-packages\ampy\cli.py", line 213, in put
board_files.put(remote, infile.read())
File "d:\program files\python\python36\lib\site-packages\ampy\files.py", line 137, in put
self._pyboard.exec_("f = open('{0}', 'wb')".format(filename))
File "d:\program files\python\python36\lib\site-packages\ampy\pyboard.py", line 265, in exec_
raise PyboardError('exception', ret, ret_err)
ampy.pyboard.PyboardError: ('exception', b'', b'Traceback (most recent call last):\r\n File "<stdin>", line 1, in <module>\r\nOSError: [Errno 1] EPERM\r\n')

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

Re: ESP32 boards

#187 Post by LisaM » 21 Mar 2018, 23:00

BertB wrote: 21 Mar 2018, 22:38 It is also impossible to use ampy to upload main.py
D:\Program Files\Python\Python36>ampy --port COM6 put D:\Tools\uPython\main.py
Traceback (most recent call last):
File "d:\program files\python\python36\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "d:\program files\python\python36\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:\Program Files\Python\Python36\Scripts\ampy.exe\__main__.py", line 9, in <module>
File "d:\program files\python\python36\lib\site-packages\click\core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "d:\program files\python\python36\lib\site-packages\click\core.py", line 697, in main
rv = self.invoke(ctx)
File "d:\program files\python\python36\lib\site-packages\click\core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "d:\program files\python\python36\lib\site-packages\click\core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "d:\program files\python\python36\lib\site-packages\click\core.py", line 535, in invoke
return callback(*args, **kwargs)
File "d:\program files\python\python36\lib\site-packages\ampy\cli.py", line 213, in put
board_files.put(remote, infile.read())
File "d:\program files\python\python36\lib\site-packages\ampy\files.py", line 137, in put
self._pyboard.exec_("f = open('{0}', 'wb')".format(filename))
File "d:\program files\python\python36\lib\site-packages\ampy\pyboard.py", line 265, in exec_
raise PyboardError('exception', ret, ret_err)
ampy.pyboard.PyboardError: ('exception', b'', b'Traceback (most recent call last):\r\n File "<stdin>", line 1, in <module>\r\nOSError: [Errno 1] EPERM\r\n')
No need to upload main.py! Main.py is 'frozen', meaning it's part of the firmware.
Using 'import upyeasy' loads the uPyEasy module (which include main.py) into memory and 'upyeasy.main()' runs upyEasy.

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

Re: ESP32 boards

#188 Post by karl222 » 22 Mar 2018, 08:30

uiuiui, still a long way to go...

:roll:

i’ll give it a try in the evening....

karl

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

Re: ESP32 boards

#189 Post by raptor » 22 Mar 2018, 11:47

Hello, Lisa :) The connection to my router is successful, but when i make request to 192.168.100.3 from my browser it tells me that is unable to connect.
This is what I got:

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:0x3fff0018,len:4
load:0x3fff001c,len:4416
ho 0 tail 12 room 4
load:0x40078000,len:0
load:0x40078000,len:11816
entry 0x4007a9fc
I (265) cpu_start: Pro cpu up.
I (265) cpu_start: Single core mode
I (265) heap_init: Initializing. RAM available for dynamic allocation:
I (269) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (275) heap_init: At 3FFC4E80 len 0001B180 (108 KiB): DRAM
I (281) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (288) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (294) heap_init: At 4008DE34 len 000121CC (72 KiB): IRAM
I (300) cpu_start: Pro cpu start user code
I (20) cpu_start: Starting scheduler on PRO CPU.
OSError: [Errno 2] ENOENT
MicroPython v1.9.3-473-g22c693a-dirty on 2018-03-21; ESP32 module with ESP32
Type "help()" for more information.
>>> import upyeasy
I (19363) modsocket: Initializing
>>> import network
>>> station = network.WLAN(network.STA_IF)
I (86893) wifi: wifi firmware version: ebd3e5d
I (86893) wifi: config NVS flash: enabled
I (86893) wifi: config nano formating: disabled
I (86893) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (86903) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (86923) wifi: Init dynamic tx buffer num: 32
I (86923) wifi: Init data frame dynamic rx buffer num: 64
I (86923) wifi: Init management frame dynamic rx buffer num: 64
I (86933) wifi: wifi driver task: 3ffcaf40, prio:23, stack:4096
I (86933) wifi: Init static rx buffer num: 10
I (86943) wifi: Init dynamic rx buffer num: 0
I (86943) wifi: wifi power manager task: 0x3ffcfb90 prio: 21 stack: 2560
I (87013) phy: phy_version: 383.0, 79a622c, Jan 30 2018, 15:38:06, 0, 0
I (87013) wifi: mode : null
>>> station.active(True)
I (98793) wifi: mode : sta (30:ae:a4:04:80:30)
I (98793) wifi: STA_START
True
>>> station.connect("my_ssid", "my_pass")
>>> I (132043) wifi: n:10 0, o:1 0, ap:255 255, sta:10 0, prof:1
I (132603) wifi: state: init -> auth (b0)
I (132603) wifi: state: auth -> assoc (0)
I (132613) wifi: state: assoc -> run (10)
I (132673) wifi: connected with OpenWrt2, channel 10
I (132673) network: event 4
I (133893) event: sta ip: 192.168.100.3, mask: 255.255.255.0, gw: 192.168.100.1
I (133893) network: GOT_IP
I (135613) wifi: pm start, type:0

>>> print('network config:', station.ifconfig())
network config: ('192.168.100.3', '255.255.255.0', '192.168.100.1', '192.168.100.1')
>>> station.isconnected()
True
>>>

I've got ping to 192.168.100.3, but seems web server isn't working.
What I'm missing?
Regards from Bulgaria.
raptor

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

Re: ESP32 boards

#190 Post by LisaM » 22 Mar 2018, 15:48

raptor wrote: 22 Mar 2018, 11:47 Hello, Lisa :) The connection to my router is successful, but when i make request to 192.168.100.3 from my browser it tells me that is unable to connect.
This is what I got:
I've got ping to 192.168.100.3, but seems web server isn't working.
What I'm missing?
It's working, cool!
The webserver doesn't work, because you're only connected to the wifi (which doesn't include a webserver).

To run uPyEasy:
>>> import upyeasy
>>> upyeasy.main()

Part of the uPyEasy module is a fully functional webserver, so you should be able to connect now...

Cheers,

Lisa

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

Re: ESP32 boards

#191 Post by raptor » 22 Mar 2018, 22:15

Lisa, you are great ;) Thank you, very much for your help! I have working ESP32 module with uPyEasy firmware. I will be glad to help in developing and popularization of this great firmware :)
Attachments
Screenshot from 2018-03-22 23-05-37.png
Screenshot from 2018-03-22 23-05-37.png (131.6 KiB) Viewed 85904 times
Regards from Bulgaria.
raptor

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

Re: ESP32 boards

#192 Post by karl222 » 22 Mar 2018, 22:42

yep, Installation was successful:
ets Jun 8 2016 00:22:57

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.

BUT, I can't set wifi Parameters accordingly via Python window:

>>> upyeasy.setwifi('xxxxx', 'yyyyyyy')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'upyeasy' is not defined
>>>

even when I do this, it doesn't work:

>>> import upyeasy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'upyeasy'
>>>

Any Ideas?

thx
karl

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

Re: ESP32 boards

#193 Post by karl222 » 22 Mar 2018, 22:43

LisaM wrote: 22 Mar 2018, 15:48
raptor wrote: 22 Mar 2018, 11:47 Hello, Lisa :) The connection to my router is successful, but when i make request to 192.168.100.3 from my browser it tells me that is unable to connect.
This is what I got:
I've got ping to 192.168.100.3, but seems web server isn't working.
What I'm missing?
It's working, cool!
The webserver doesn't work, because you're only connected to the wifi (which doesn't include a webserver).

To run uPyEasy:
>>> import upyeasy
>>> upyeasy.main()

Part of the uPyEasy module is a fully functional webserver, so you should be able to connect now...

Cheers,

Lisa
How can the webserver be started via autostart? what is the reason behind the logic of being startet not automatically?

thx
karl

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

Re: ESP32 boards

#194 Post by BertB » 22 Mar 2018, 23:14

I followed all the steps of Raptor, no success:
rst:0x10 (RTCWDT_RTC_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 (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.
>>> print('network config:', station.ifconfig())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'station' is not defined
>>> import upyeasy
I (51960) modsocket: Initializing
>>> import network
>>> station = network.WLAN(network.STA_IF)
I (66090) wifi: wifi firmware version: 111e74d
I (66090) wifi: config NVS flash: enabled
I (66090) wifi: config nano formating: disabled
I (66100) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (66100) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (66120) wifi: Init dynamic tx buffer num: 32
I (66120) wifi: Init data frame dynamic rx buffer num: 64
I (66120) wifi: Init management frame dynamic rx buffer num: 64
I (66130) wifi: wifi driver task: 3ffddfb0, prio:23, stack:4096
I (66140) wifi: Init static rx buffer num: 10
I (66140) wifi: Init dynamic rx buffer num: 0
I (66140) wifi: Init rx ampdu len mblock:7
I (66150) wifi: Init lldesc rx ampdu entry mblock:4
I (66150) wifi: wifi power manager task: 0x3ffe85b4 prio: 21 stack: 2560
I (66180) phy: phy_version: 362.0, 61e8d92, Sep 8 2017, 18:48:11, 0, 0
I (66180) wifi: mode : null
>>> station.active(True)
I (75420) wifi: mode : sta (30:ae:a4:22:e8:1c)
I (75420) wifi: STA_START
True
>>> station.connect("xxxxxxx", "xxxxxxxxx")
>>> I (109500) wifi: n:7 1, o:1 0, ap:255 255, sta:7 1, prof:1
I (110060) wifi: state: init -> auth (b0)
I (110060) wifi: state: auth -> assoc (0)
I (110070) wifi: state: assoc -> run (10)
I (110080) wifi: connected with xxxxxxxx, channel 7
I (110080) network: event 4
I (110950) event: sta ip: -------------, mask: 255.255.255.0, gw: -----------
I (110950) network: GOT_IP
I (113070) wifi: pm start, type:0

print('network config:', station.ifconfig())
network config: ('------------', '255.255.255.0', '----------', '-----------')
>>> station.isconnected()
True
>>> upyeasy.main()
loaded sink log
loaded sink console
loaded sink syslog
2000-01-01T00:02:17.005 [debug] uPyEasy: Init: Init constructor
2000-01-01T00:02:17.005 [debug] uPyEasy: Init: Entering init
2000-01-01 00:02:17 [debug] uPyEasy: Init: Create directory config
2000-01-01 00:02:17 [debug] uPyEasy: Init: Create directory config exception: OSError(17,)
2000-01-01 00:02:17 [debug] uPyEasy: Init: Create directory plugins
2000-01-01 00:02:18 [debug] uPyEasy: Init: Create directory plugins exception: OSError(17,)
2000-01-01 00:02:18 [debug] uPyEasy: Init: Create directory protocols
2000-01-01 00:02:18 [debug] uPyEasy: Init: Create directory protocols exception: OSError(17,)
2000-01-01 00:02:18 [debug] uPyEasy: Init: Create directory scripts
2000-01-01 00:02:18 [debug] uPyEasy: Init: Create directory scripts exception: OSError(17,)
2000-01-01 00:02:18 [debug] uPyEasy: Init: Create directory rules
2000-01-01 00:02:18 [debug] uPyEasy: Init: Create directory rules exception: OSError(17,)
2000-01-01 00:02:18 [debug] uPyEasy: Init: config Table
2000-01-01 00:02:18 [debug] uPyEasy: Init: network Table
2000-01-01 00:02:18 [debug] uPyEasy: Init: protocol Table
2000-01-01 00:02:18 [debug] uPyEasy: Init: controller Table
2000-01-01 00:02:18 [debug] uPyEasy: Init: hardware Table
2000-01-01 00:02:18 [debug] uPyEasy: Init: dxpin Table
2000-01-01 00:02:18 [debug] uPyEasy: Init: dxmap Table
2000-01-01 00:02:18 [debug] uPyEasy: Init: plugin Table
2000-01-01 00:02:18 [debug] uPyEasy: Init: pluginstore Table
2000-01-01 00:02:18 [debug] uPyEasy: Init: device Table
2000-01-01 00:02:18 [debug] uPyEasy: Init: service Table
2000-01-01 00:02:18 [debug] uPyEasy: Init: notification Table
2000-01-01 00:02:18 [debug] uPyEasy: Init: advanced Table
2000-01-01 00:02:18 [debug] uPyEasy: Init: script Table
2000-01-01 00:02:18 [debug] uPyEasy: Init: rule Table
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "upyeasy/__init__.py", line 40, in main
File "upyeasy/init.py", line 158, in init
File "upyeasy/db.py", line 43, in public
File "upyeasy/db.py", line 1, in <listcomp>
File "filedb.py", line 91, in get
OSError: [Errno 19] ENODEV

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

Re: ESP32 boards

#195 Post by LisaM » 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?

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

Re: ESP32 boards

#196 Post by BertB » 23 Mar 2018, 17:10

This is the sequence with the 2048 bin.
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 (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.
OSError: [Errno 2] ENOENT
MicroPython v1.9.3-255-g979c688-dirty on 2018-03-21; ESP32 module with ESP32
Type "help()" for more information.
>>> import upyeasy
I (19590) modsocket: Initializing
>>> ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x3f (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_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 (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 (465) 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 (48) 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.
>>> import upyeasy
I (86063) modsocket: Initializing
>>> import network
>>> station = network.WLAN(network.STA_IF)
Traceback (most recent call last):
File "<stdin>", line 1
IndentationError: unexpected indent
>>> station = network.WLAN(network.STA_IF)
I (149973) wifi: wifi firmware version: 111e74d
I (149973) wifi: config NVS flash: enabled
I (149973) wifi: config nano formating: disabled
I (149973) system_api: Base MAC address is not set, read default base MAC addres s from BLK0 of EFUSE
I (149983) system_api: Base MAC address is not set, read default base MAC addres s from BLK0 of EFUSE
I (150003) wifi: Init dynamic tx buffer num: 32
I (150003) wifi: Init data frame dynamic rx buffer num: 64
I (150003) wifi: Init management frame dynamic rx buffer num: 64
I (150013) wifi: wifi driver task: 3ffe15f4, prio:23, stack:4096
I (150023) wifi: Init static rx buffer num: 10
I (150023) wifi: Init dynamic rx buffer num: 0
I (150023) wifi: Init rx ampdu len mblock:7
I (150033) wifi: Init lldesc rx ampdu entry mblock:4
I (150033) wifi: wifi power manager task: 0x3ffe8508 prio: 21 stack: 2560
W (150043) phy_init: failed to load RF calibration data (0x1102), falling back t o full calibration
I (150203) phy: phy_version: 362.0, 61e8d92, Sep 8 2017, 18:48:11, 0, 2
I (150213) wifi: mode : null
>>> station.active(True)
I (166333) wifi: mode : sta (30:ae:a4:22:e8:1c)
I (166333) wifi: STA_START
True
>>> station.connect("xxxxx", "xxxxxx"
... )
>>> I (207423) wifi: n:7 1, o:1 0, ap:255 255, sta:7 1, prof:1
I (207983) wifi: state: init -> auth (b0)
I (207983) wifi: state: auth -> assoc (0)
I (207993) wifi: state: assoc -> run (10)
I (208003) wifi: connected with Spoon, channel 7
I (208003) network: event 4
I (208673) event: sta ip: xxxxxxxxx, mask: xxxxx, gw: xxxxxxx
I (208673) network: GOT_IP
I (210993) wifi: pm start, type:0

print('network config:', station.ifconfig())
network config: (xxxxxxxx', 'xxxxxxxxx', 'xxxxxxxx', 'xxxxxxxxxxx')
>>> station.isconnected()
True
>>> upyeasy.main()
loaded sink log
loaded sink console
loaded sink syslog
2000-01-01T00:03:50.005 [debug] uPyEasy: Init: Init constructor
2000-01-01T00:03:50.005 [debug] uPyEasy: Init: Entering init
2000-01-01 00:03:50 [debug] uPyEasy: Init: Create directory config
2000-01-01 00:03:50 [debug] uPyEasy: Init: Create directory plugins
2000-01-01 00:03:50 [debug] uPyEasy: Init: Create directory protocols
2000-01-01 00:03:50 [debug] uPyEasy: Init: Create directory scripts
2000-01-01 00:03:51 [debug] uPyEasy: Init: Create directory rules
2000-01-01 00:03:51 [debug] uPyEasy: Init: config Table
2000-01-01 00:03:51 [debug] uPyEasy: Init: network Table
2000-01-01 00:03:52 [debug] uPyEasy: Init: protocol Table
2000-01-01 00:03:52 [debug] uPyEasy: Init: controller Table
2000-01-01 00:03:52 [debug] uPyEasy: Init: hardware Table
2000-01-01 00:03:52 [debug] uPyEasy: Init: dxpin Table
2000-01-01 00:03:53 [debug] uPyEasy: Init: dxmap Table
2000-01-01 00:03:53 [debug] uPyEasy: Init: plugin Table
2000-01-01 00:03:53 [debug] uPyEasy: Init: pluginstore Table
2000-01-01 00:03:53 [debug] uPyEasy: Init: device Table
2000-01-01 00:03:54 [debug] uPyEasy: Init: service Table
2000-01-01 00:03:54 [debug] uPyEasy: Init: notification Table
2000-01-01 00:03:54 [debug] uPyEasy: Init: advanced Table
2000-01-01 00:03:55 [debug] uPyEasy: Init: script Table
2000-01-01 00:03:55 [debug] uPyEasy: Init: rule Table
2000-01-01 00:03:55 [debug] uPyEasy: Init: Create Config Record
2000-01-01 00:03:56 [debug] uPyEasy: Init: Create Network Record
2000-01-01 00:03:56 [debug] uPyEasy: Init: Create Hardware Record
2000-01-01 00:03:56 [debug] uPyEasy: Hal: hardwaredb init
2000-01-01 00:03:56 [debug] uPyEasy: Hal: hardwaredb esp32
2000-01-01 00:03:56 [debug] uPyEasy: Init: Create dxpin Record
2000-01-01 00:03:57 [debug] uPyEasy: Hal: dxpins_init
2000-01-01 00:03:57 [debug] uPyEasy: Hal: dxpins_init esp32
2000-01-01 00:03:57 [debug] uPyEasy: Init: Create advanced Record
2000-01-01 00:03:58 [debug] uPyEasy: Hal: Init
2000-01-01 00:03:58 [debug] uPyEasy: Hal: init, network record present
2000-01-01 00:03:58 [debug] uPyEasy: Hal: esp32
2000-01-01 00:03:58 [debug] uPyEasy: Hal: esp32, ssid empty
I (256873) network: event 1
2000-01-01 00:04:00 [debug] uPyEasy: Hal: esp32, Scan: Ssid found: Spoon Strengt h: -73 dBm Security: 3
2000-01-01 00:04:00 [debug] uPyEasy: Hal: esp32, Scan: Ssid found: Lepelke Stren gth: -77 dBm Security: 3
2000-01-01 00:04:00 [debug] uPyEasy: Hal: esp32, Scan: Ssid found: torenvalk Str ength: -90 dBm Security: 3
2000-01-01 00:04:00 [debug] uPyEasy: Hal: esp32, Scan: Ssid found: Ziggo9D8234B Strength: -91 dBm Security: 3
2000-01-01 00:04:01 [debug] uPyEasy: Hal: esp32, Scan: Ssid found: Ziggo Strengt h: -91 dBm Security: 5
2000-01-01 00:04:01 [debug] uPyEasy: Hal: esp32, Scan: Ssid found: Ziggo Strengt h: -93 dBm Security: 5
2000-01-01 00:04:01 [debug] uPyEasy: Hal: esp32, Scan: Ssid found: HZN240406906 Strength: -93 dBm Security: 3
2000-01-01 00:04:01 [debug] uPyEasy: Hal: esp32, Scan: Ssid found: CelenoInitial AP8A186F Strength: -94 dBm Security: 3
2000-01-01 00:04:01 [debug] uPyEasy: Protocols: Load
2000-01-01 00:04:01 [debug] uPyEasy: Protocols: Init protocol records
2000-01-01 00:04:01 [debug] uPyEasy: Protocols: Load protocol domoticz_mqtt
2000-01-01 00:04:01 [debug] uPyEasy: Protocols: Create protocol Record: domoticz _mqtt
2000-01-01 00:04:01 [debug] uPyEasy: Protocols: Load protocol domoticz_http
2000-01-01 00:04:01 [debug] uPyEasy: Protocols: Create protocol Record: domoticz _http
2000-01-01 00:04:02 [debug] uPyEasy: Protocols: Init protocol records, run async loop
2000-01-01 00:04:02 [debug] uPyEasy: Plugins: Load
2000-01-01 00:04:02 [debug] uPyEasy: Plugins: init plugin records
2000-01-01 00:04:02 [debug] uPyEasy: Plugins: Register frozen plugin switch
2000-01-01 00:04:02 [debug] uPyEasy: Plugin: switch contruction
2000-01-01 00:04:02 [debug] uPyEasy: Plugins: Create frozen plugin Record: switc h
2000-01-01 00:04:02 [debug] uPyEasy: Plugins: Register frozen plugin bme280
2000-01-01 00:04:03 [debug] uPyEasy: Plugins: Create frozen plugin Record: bme28 0
2000-01-01 00:04:03 [debug] uPyEasy: Plugins: Register frozen plugin test
2000-01-01 00:04:03 [debug] uPyEasy: Plugins: Create frozen plugin Record: test
2000-01-01 00:04:03 [debug] uPyEasy: Plugins: Register frozen plugin ds18
2000-01-01 00:04:03 [debug] uPyEasy: Plugin: ds18 contruction
2000-01-01 00:04:03 [debug] uPyEasy: Plugins: Create frozen plugin Record: ds18
2000-01-01 00:04:04 [debug] uPyEasy: Plugins: Init plugin records, run async loo p
2000-01-01 00:04:04 [debug] uPyEasy: Init: Init devices
2000-01-01 00:04:04 [debug] uPyEasy: Scripts: Load
2000-01-01 00:04:04 [debug] uPyEasy: Scripts: Init
2000-01-01 00:04:04 [debug] uPyEasy: Plugins: GetQueue
2000-01-01 00:04:04 [debug] uPyEasy: Scripts: init scripts records
2000-01-01 00:04:04 [debug] uPyEasy: Scripts: init rules records
2000-01-01 00:04:04 [debug] uPyEasy: Scripts: Init script/rule records, run asyn c loop
2000-01-01 00:04:04 [debug] uPyEasy: Utils: Sys hostname
2000-01-01 00:04:05 [debug] uPyEasy: Utils: uPyEasy Name
Set syslog hostname 0.0.0.0
reloaded sink syslog
2000-01-01 00:04:05 [debug] uPyEasy-uPyEasy: Hal: Entering SetTime
2000-01-01 00:04:05 [debug] uPyEasy-uPyEasy: Hal: Entering GetNtpTime
2000-01-01 00:04:05 [debug] uPyEasy-uPyEasy: Hal: network Table
2000-01-01 00:04:05 [debug] uPyEasy-uPyEasy: Hal: Using NTP Hostname: pool.ntp.o rg
2000-01-01 00:04:05 [debug] uPyEasy-uPyEasy: Hal: TimeZome offset: 60
2000-01-01 00:04:05 [debug] uPyEasy-uPyEasy: Hal: Received UTC NTP Time: 5751363 35
2000-01-01 00:04:05 [debug] uPyEasy-uPyEasy: Hal: Timezone corrected NTP Time: 5 75139935
2000-01-01 00:04:05 [debug] uPyEasy-uPyEasy: Hal: DST corrected NTP Time: 575139 935
2000-01-01 00:04:05 [debug] uPyEasy-uPyEasy: Hal: Received NTP Time: 575139935
2000-01-01 00:04:05 [debug] uPyEasy-uPyEasy: Hal: StartTime: 575139935
2018-03-23 17:05:35 [debug] uPyEasy-uPyEasy: Set time: 2018-03-23T17:05:35
Exiting: Network not available, set network values!
>>> upyeasy.setwifi('xxxxxxxxxxx','xxxxxxxxxxxxx')
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
>>>

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

Re: ESP32 boards

#197 Post by LisaM » 23 Mar 2018, 18:18

@bertb: and now a reboot and only do:
>>> import upyeasy
>>> upyeasy.main()
Still a network not found error?

Ps. Thx! line 46 of utils.py had a bug! It stated

Code: Select all

db.configTable.update({"timestamp":network['timestamp']},port = wport)
But it should have been:

Code: Select all

db.configTable.update({"timestamp":config['timestamp']},port = wport)
Found it due to the micropython error trail!

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

Re: ESP32 boards

#198 Post by BertB » 23 Mar 2018, 18:49

Great, it runs.
But ...

First I added the BME280. That went good.
Znd then, when I ad a DS18B20 device, the interface looses connection and this is the trace:
stack: 2032 out of 15360
GC: total: 96000, used: 90224, free: 5776
No. of 1-blocks: 1468, 2-blocks: 179, max blk sz: 902, max free sz: 360
575145912.170 <HTTPRequest object at 3ffc9250> <StreamWriter <socket>> "POST /device_setting?id=0"
2018-03-23 18:44:49 [debug] uPyEasy-uPyEasy: Pages: Authorize User!?
2018-03-23 18:44:49 [debug] uPyEasy-uPyEasy: Pages: Entering Device Settings Page
2018-03-23 18:44:49 [debug] uPyEasy-uPyEasy: Pages: POST
2018-03-23 18:44:49 [debug] uPyEasy-uPyEasy: id
2018-03-23 18:44:49 [debug] uPyEasy-uPyEasy: 0
2018-03-23 18:44:50 [debug] uPyEasy-uPyEasy: New Plugin: 4
2018-03-23 18:44:50 [debug] uPyEasy-uPyEasy: Pages: Create Device
2018-03-23 18:44:50 [debug] uPyEasy-uPyEasy: Pages: New Device and plugin choosen: 4
2018-03-23 18:44:50 [debug] uPyEasy-uPyEasy: Utils: uPyEasy Name
2018-03-23 18:44:51 [debug] uPyEasy-uPyEasy: Plugins: Init device: dummy with plugin: 4
2018-03-23 18:44:51 [debug] uPyEasy-uPyEasy: Protocols: GetQueue controller 192.168.0.243-Domoticz HTTP-1
2018-03-23 18:44:52 [debug] uPyEasy-uPyEasy: Plugin: ds18 contruction
2018-03-23 18:44:52 [debug] uPyEasy-uPyEasy: Plugins: Init device: dummy ,instantiate plugin: DS18B20
2018-03-23 18:44:52 [debug] uPyEasy-uPyEasy: Utils: uPyEasy Name
2018-03-23 18:44:52 [debug] uPyEasy-uPyEasy: Plugin: ds18 init
2018-03-23 18:44:52 [debug] uPyEasy-uPyEasy: Plugins: Read device store: dummy
2018-03-23 18:44:52 [debug] uPyEasy-uPyEasy: Plugin: ds18 init, pin used:
2018-03-23 18:44:52 [debug] uPyEasy-uPyEasy: Hal: pin =
575145912.170 <HTTPRequest object at 3ffc9250> <StreamWriter <socket>> AttributeError("'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 84, in init
File "onewire.py", line 17, in __init__
AttributeError: 'NoneType' object has no attribute 'init'
After that I rebooted and tried it again with the DS18B20 and it worked.

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

Re: ESP32 boards

#199 Post by BertB » 23 Mar 2018, 19:41

having said that, There still is no automatic update of the devices and no value is written to Domoticz.

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

Re: ESP32 boards

#200 Post by karl222 » 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

BertB
Normal user
Posts: 1049
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: 90
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: 90
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: 1049
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: 1049
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: 1049
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: 1049
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: 1049
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: 1049
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.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests