uPyEasy

Moderators: Voyager, BertB, grovkillen, Stuntteam, LisaM

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

Re: uPyEasy

#71 Post by BertB » 15 Nov 2017, 15:25

My zero has onboard wifi and bluetooth and had a price of 11 euro.

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

Re: uPyEasy

#72 Post by LisaM » 15 Nov 2017, 15:59

Doesn't matter, because i don't care if it's a Raspberry or Orange. uPyEasy is running on Armbian and if the Raspberry is running Armbian, it's going to run there also (probably since it can't test it).

Are you running Raspberry Pi Zero - Armbian? If so, are you willing to test it? ;)

Cheers,

Lisa

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

Re: uPyEasy

#73 Post by budman1758 » 16 Nov 2017, 07:13

It does not look like Armbian has any images for Raspberry anything. Their focus seems to be ARM and Allwinner chips. Thats not to say it cant be ported to Raspberry. Don't have a clue on that tho.....

Is uPyEasy running as an app on your Armbian boards or is it the complete OS? :?:

I ordered an OrangePi Zero H2 and cant wait to try it out and also on an ESP32. :mrgreen:
"The glass is twice as big as it needs to be".

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

Re: uPyEasy

#74 Post by LisaM » 16 Nov 2017, 20:15

budman1758 wrote: 16 Nov 2017, 07:13 Is uPyEasy running as an app on your Armbian boards or is it the complete OS? :?:
It's an app build on Armbian, it might work on other linux versions or not. The reason to choose for Armbian is interrupts from the OS, the OS needs to be very light and small so it doesn't interrupt uPyEasy operation to much. To many interrupt means less reliable operation of uPyEasy since it might miss sensor values due to the interrupt. Also the dxpin library is a concern, for Armbian there is an pin library available for micropython. Other ports might not have that.

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

Re: uPyEasy

#75 Post by BertB » 17 Nov 2017, 22:51

LisaM wrote: 15 Nov 2017, 15:59 Doesn't matter, because i don't care if it's a Raspberry or Orange. uPyEasy is running on Armbian and if the Raspberry is running Armbian, it's going to run there also (probably since it can't test it).

Are you running Raspberry Pi Zero - Armbian? If so, are you willing to test it? ;)

Cheers,

Lisa
No and yes. I run have raspbian on rpi's, but let's see if I can get it running Armbian

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

Re: uPyEasy

#76 Post by LisaM » 18 Nov 2017, 00:03

BertB wrote: 17 Nov 2017, 22:51 No and yes. I run have raspbian on rpi's, but let's see if I can get it running Armbian
If not, maybe it also works on Raspbian.

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

Re: uPyEasy

#77 Post by BertB » 19 Nov 2017, 12:59

So far, I cannot find Armbian for Raspberry.
Sure, I am willing to try uPyEasy on a Zero.
Provided you have some kind of howto for me.

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

Re: uPyEasy

#78 Post by LisaM » 08 Dec 2017, 19:34

Finally i have created a working uPyEasy version that has working protocols (domoticz http/mqtt) and plugins (bme280, dht11/22, switch). The plugins pass fake values, not real ones. The reason for that, while the sensor code is already in place, is that i need to add sensors to my test platforms to be able to test the sensors and i want the values always to be the same for debugging purposes. So, while everything is functional it's not sending real values but fake values to domoticz.
Only the PyBoard firmware in the google drive section is updated! The ESP32 has run into a bug which i'm working on with the micropython developers.
The Orange PI/Raspberry PI version is next and i will post a message here if it's ready.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: uPyEasy

#79 Post by grovkillen » 08 Dec 2017, 20:24

LisaM wrote: 08 Dec 2017, 19:34 Finally i have created a working uPyEasy version that has working protocols (domoticz http/mqtt) and plugins (bme280, dht11/22, switch). The plugins pass fake values, not real ones. The reason for that, while the sensor code is already in place, is that i need to add sensors to my test platforms to be able to test the sensors and i want the values always to be the same for debugging purposes. So, while everything is functional it's not sending real values but fake values to domoticz.
Only the PyBoard firmware in the google drive section is updated! The ESP32 has run into a bug which i'm working on with the micropython developers.
The Orange PI/Raspberry PI version is next and i will post a message here if it's ready.
I love that you are thinking ahead while we're working on the current code base. Good work this far!
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

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

Re: uPyEasy

#80 Post by AndrewJ » 09 Dec 2017, 12:19

Great work, thanks for the update. Good luck with fixing the ESP32 bug!

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

Re: uPyEasy

#81 Post by LisaM » 10 Dec 2017, 02:12

Bug not fixed, but work-around found. It's now working and not, since another issue popped up... :cry:
Searching for solution.

-UPDATE- IDF settings adjusted, it's working now (domoticz virtual sensor is now updated continuously).

ESP32 image in google drive is updated to the latest version.

PS. Changes: Default web port now 80 instead of 8081, port is also configurable in config tab.
Last edited by LisaM on 11 Dec 2017, 00:47, edited 1 time in total.

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

Re: uPyEasy

#82 Post by AndrewJ » 10 Dec 2017, 22:38

Lisa, Good news about the ESP32 workaround. :)
I'm trying to access the Google Drive using the link you sent me by PM some weeks ago, but I get a 404 error. Could you send me an updated link, please?
Tia
AndrewJ

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

Re: uPyEasy

#83 Post by CHK_BLN » 10 Dec 2017, 23:44

Hi Lisa
with the new firmware for the ESP32, the WIFI configuration does not work anymore.

The following error message comes.

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

greeting

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

Re: uPyEasy

#84 Post by LisaM » 10 Dec 2017, 23:53

CHK_BLN wrote: 10 Dec 2017, 23:44 Hi Lisa
with the new firmware for the ESP32, the WIFI configuration does not work anymore.

The following error message comes.

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

greeting
>>> import upyeasy
>>> upyeasy.setwifi('SSID', 'PASSSWORD','BACKUPSSID', 'BACKUPPW')
Should do the trick.

Cheers,

Lisa

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

Re: uPyEasy

#85 Post by LisaM » 11 Dec 2017, 00:50

I also had an alpha esp32 tester with a board that didn't work, but i seem to have lost the pm. Can this person please pm me again with the esp32 error details? Sorry for the confusion.

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

Re: uPyEasy

#86 Post by AndrewJ » 11 Dec 2017, 10:08

Hi Lisa, this alpha tester could be me ... I'll pm you.
AndrewJ

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

Re: uPyEasy

#87 Post by CHK_BLN » 11 Dec 2017, 21:50

Hi Lisa

I tried your trick.
But unfortunately without success
Here is the result:

>>> import upyeasy
? [0; 32mI (99442) modsocket: Initializing? [0m

>>> upyeasy.setwifi ('SSID', 'PASSSWORD', 'BACKUPSSID', 'BACKUPPW')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "upyeasy / __ init__.py", line 28, in setwifi
File "upyeasy / utils.py", line 60, in setwifi
NameError: local variable referenced before assignment

Best regards

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

Re: uPyEasy

#88 Post by LisaM » 12 Dec 2017, 00:09

CHK_BLN wrote: 11 Dec 2017, 21:50 Hi Lisa

I tried your trick.
But unfortunately without success
Here is the result:

>>> import upyeasy
? [0; 32mI (99442) modsocket: Initializing? [0m

>>> upyeasy.setwifi ('SSID', 'PASSSWORD', 'BACKUPSSID', 'BACKUPPW')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "upyeasy / __ init__.py", line 28, in setwifi
File "upyeasy / utils.py", line 60, in setwifi
NameError: local variable referenced before assignment

Best regards
Probably are the tables not created yet can you try (after reboot):
>>> import upyeasy
>>> upyeasy.main()
>>> upyeasy.setwifi ('SSID', 'PASSSWORD', 'BACKUPSSID', 'BACKUPPW')

Then no more errors should appear, if so: reboot, import upyeasy, upyeasy.main()

I'll fix the bug so that upyeasy is started automatically again after reboot

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

Re: uPyEasy

#89 Post by AndrewJ » 12 Dec 2017, 19:48

I tried the steps recommended in your reply to CHK_BLN, but sadly not working yet.

After a hardware reboot, reconnected to screen...
>>> import upyeasy - no errors

>>> upyeasy.main() - I got the following output:

I (12626650) wifi: wifi driver task: 3ffde154, prio:23, stack:4096
I (12626650) wifi: Init static rx buffer num: 10
I (12626660) wifi: Init dynamic rx buffer num: 0
I (12626660) wifi: Init rx ampdu len mblock:7
I (12626660) wifi: Init lldesc rx ampdu entry mblock:4
I (12626670) wifi: wifi power manager task: 0x3ffe8758 prio: 21 stack: 2560
W (12626680) phy_init: failed to load RF calibration data (0x1102), falling back to full calibration

Brownout detector was triggered

Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:4364
load:0x40078000,len:0
load:0x40078000,len:10992
entry 0x4007a6c4
I (242) cpu_start: Pro cpu up.
I (242) cpu_start: Single core mode
I (242) heap_init: Initializing. RAM available for dynamic allocation:
I (246) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (252) heap_init: At 3FFDCDD0 len 00003230 (12 KiB): DRAM
I (258) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (264) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (271) heap_init: At 4009005C len 0000FFA4 (63 KiB): IRAM
I (277) cpu_start: Pro cpu start user code
I (71) cpu_start: Starting scheduler on PRO CPU.
OSError: [Errno 2] ENOENT
MicroPython v1.9.2-447-g0ef2d8e-dirty on 2017-12-10; ESP32 module with ESP32
Type "help()" for more information.
>>>

The brownout reference made me wonder about power supply issues. "Shouldn't" be a problem as I'm using a powered USB hub to connect my ESP32 to Raspberry Pi3. Having said that, there seems to be an error before that (RF calibration data).

ESP32 is a DOIT ESP32 Devkit V1.

Any ideas where it's going wrong?

Edit: I then tried help() in the REPL, and got the following information if it's of any help....

>>> help()
Welcome to MicroPython on the ESP32!

For generic online docs please visit http://docs.micropython.org/

For access to the hardware use the 'machine' module:

import machine
pin12 = machine.Pin(12, machine.Pin.OUT)
pin12.value(1)
pin13 = machine.Pin(13, machine.Pin.IN, machine.Pin.PULL_UP)
print(pin13.value())
i2c = machine.I2C(scl=machine.Pin(21), sda=machine.Pin(22))
i2c.scan()
i2c.writeto(addr, b'1234')
i2c.readfrom(addr, 4)

Basic WiFi configuration:

import network
sta_if = network.WLAN(network.STA_IF); sta_if.active(True)
sta_if.scan() # Scan for available access points
sta_if.connect("<AP_name>", "<password>") # Connect to an AP
sta_if.isconnected() # Check for successful connection

Control commands:
CTRL-A -- on a blank line, enter raw REPL mode
CTRL-B -- on a blank line, enter normal REPL mode
CTRL-C -- interrupt a running program
CTRL-D -- on a blank line, do a soft reset of the board
CTRL-E -- on a blank line, enter paste mode

For further help on a specific object, type help(obj)
For a list of available modules, type help('modules')
>>>


I'm going to lie down and do some Guru Meditation!!
Cheers
AndrewJ.

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

Re: uPyEasy

#90 Post by CHK_BLN » 12 Dec 2017, 22:45

Hi Lisa
your help worked.
But after a reboot the settings are lost.
Best regards

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

Re: uPyEasy

#91 Post by AndrewJ » 12 Dec 2017, 22:59

Hi again Lisa,
Some progress now although not yet there ....

Discovered that my microUSB connector was not secure in the ESP32, it now looks like this was the main cause of my recent problems, so please ignore my post earlier this evening.

Repeated the whole process from the start with a better usb connection.
This time, no errors from upyeasy.main(). Went on to configure wifi settings.
Rebooted, and repeated import upyeasy, upyeasy.main() as per latest advice.
ESP32 started and showed a connection to my wifi (briefly) .... but then crashed out with OSerror 128.

This is the log (although I'm sure that some lines have now disappeared, including the wifi connection!?)

2000-01-01T00:00:56.005 [debug] uPyEasy: Protocol: domoticz http contruction
2000-01-01T00:00:56.005 [debug] uPyEasy: Protocols: Create protocol Record: domoticz_http
2000-01-01T00:00:57.005 [debug] uPyEasy: Plugins: Load
2000-01-01T00:00:57.005 [debug] uPyEasy: Plugins: Delete plugin records
2000-01-01T00:00:57.005 [debug] uPyEasy: Plugins: Load frozen plugin gpio
2000-01-01T00:00:57.005 [debug] uPyEasy: Plugin: gpio contruction
2000-01-01T00:00:57.005 [debug] uPyEasy: Plugins: Create frozen plugin Record: gpio
I (58379) wifi: pm start, type:0

2000-01-01T00:00:57.005 [debug] uPyEasy: Plugins: Load frozen plugin dht
2000-01-01T00:00:57.005 [debug] uPyEasy: Plugin: dht contruction
2000-01-01T00:00:57.005 [debug] uPyEasy: Plugins: Create frozen plugin Record: dht
2000-01-01T00:00:58.005 [debug] uPyEasy: Plugins: Load frozen plugin bme
2000-01-01T00:00:58.005 [debug] uPyEasy: Plugin: bme280 contruction
2000-01-01T00:00:58.005 [debug] uPyEasy: Plugins: Create frozen plugin Record: bme
2000-01-01T00:00:58.005 [debug] uPyEasy: Utils: Sys hostname
2000-01-01T00:00:58.005 [debug] uPyEasy: Utils: uPyEasy Name
Set syslog hostname 0.0.0.0
reloaded sink syslog
2000-01-01T00:00:58.005 [debug] uPyEasy-uPyEasy: Hal: Entering SetTime
2000-01-01T00:00:58.005 [debug] uPyEasy-uPyEasy: Hal: Entering GetNtpTime
2000-01-01T00:00:58.005 [debug] uPyEasy-uPyEasy: Hal: network Table
2000-01-01T00:00:58.005 [debug] uPyEasy-uPyEasy: Hal: Using NTP Hostname: pool.ntp.org
2000-01-01T00:00:58.005 [debug] uPyEasy-uPyEasy: Hal: TimeZome offset: 60
2000-01-01T00:00:58.005 [debug] uPyEasy-uPyEasy: Hal: Received UTC NTP Time: 566430409
2000-01-01T00:00:58.005 [debug] uPyEasy-uPyEasy: Hal: Timezone corrected NTP Time: 566434009
2000-01-01T00:00:58.005 [debug] uPyEasy-uPyEasy: Hal: DST corrected NTP Time: 566434009
2000-01-01T00:00:58.005 [debug] uPyEasy-uPyEasy: Hal: Received NTP Time: 566434009
2000-01-01T00:00:58.005 [debug] uPyEasy-uPyEasy: Hal: StartTime: 566434009
2017-12-12T22:46:49.001 [debug] uPyEasy-uPyEasy: Main: Pre-loading home page
2017-12-12T22:46:49.001 [debug] uPyEasy-uPyEasy: Main: get_ip_address AttributeError
2017-12-12T22:46:49.001 [debug] uPyEasy-uPyEasy: Main: uPyEasy Main Async Loop
* Running on http://0.0.0.0:80/
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "upyeasy/__init__.py", line 56, in main
File "picoweb/__init__.py", line 240, in run
File "uasyncio/core.py", line 124, in run_forever
File "uasyncio/core.py", line 88, in run_forever
File "uasyncio/__init__.py", line 229, in start_server
OSError: 128
>>>

Getting closer now! Hope this helps. :)
AndrewJ

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

Re: uPyEasy

#92 Post by LisaM » 13 Dec 2017, 01:15

OSError is an indication that port 80 is still locked, while upyeasy tries to open port 80. A hard reset (power down, wait 10s, power on) is required.
Then same two steps: import upyeasy, upyeasy.main()

Cheers,

Lisa

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

Re: uPyEasy

#93 Post by AndrewJ » 13 Dec 2017, 13:26

Hi Lisa,
Thanks for the reply. I just tried again unplugging the ESP32, with a long period (several minutes) before restarting, but sadly it's still not working. :(

After all the [debug] messages I see it running, for about 5 secs, then it throws an error...

* Running on http://0.0.0.0:80/
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "upyeasy/__init__.py", line 56, in main
File "picoweb/__init__.py", line 240, in run
File "uasyncio/core.py", line 124, in run_forever
File "uasyncio/core.py", line 88, in run_forever
File "uasyncio/__init__.py", line 229, in start_server
OSError: 128
>>>
Any ideas?
Cheers
Andrew

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

Re: uPyEasy

#94 Post by AndrewJ » 13 Dec 2017, 13:30

I've been googling the error messages I saw. Nothing much for File "upyeasy/__init__.py, but I did find something which sounds similar for File picoweb/__init__.py -- see this link, hope it may help ...
https://forum.micropython.org/viewtopic.php?t=3651

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

Re: uPyEasy

#95 Post by LisaM » 13 Dec 2017, 13:42

OSError 128 points to a occupied port 80 by a previous program. A hard reset (power down-wait 10s-power up) should do the trick. Then import upyeasy, upyeasy.main() should work.

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

Re: uPyEasy

#96 Post by AndrewJ » 13 Dec 2017, 18:07

Hi Lisa,
You may have missed it in my earlier post, but i had already tried the procedure you suggested. :) Anyway, I've just had another go, and in fact for good measure I went right back to the beginning, erased the ESP32 and reflashed it, the done the extra commands in the REPL. At each step where a reboot is needed, I was careful to unplug it and wait at least 10 secs.

However, I'm sorry to say that the result is still the same... it starts to run ("Running on http://0.0.0.0:80/") but then after about 5 secs it falls over with OSError 128. :( :(

I'm at a loss now, hope you may be able to suggest something please?

Cheers
AndrewJ

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

Re: uPyEasy

#97 Post by LisaM » 19 Dec 2017, 21:11

In the Google drive uPyEasy section is a new version of uPyEasy for ESP32, it has these new features:
- Autostart after flash
- Autoconnect to the strongest open wifi AP after a fresh install
- 2 working controllers (domoticz http/mqtt)
- 2 working plugins (switch/ds18b20)
- Ability to disable GPIO pins in the hardware section which are not present or being used by the board itself (every board is different)
- Tools/Wifi Scan is operational

Since it has a lot of new features, please erase your ESP32 before flashing the new firmware version (so the database is rebuild):
esptool.py --port /dev/ttyUSBx erase_flash
(x for your USB port).

The DS18B20 plugin must be save first, before you can select the romid. I'm working on that to get that fixed.

Autoconnect to the strongest open wifi AP after a fresh install? Beware that this might be your guest network which is isolated from your normal network, you'll need to forward a port on your public ip-address to port 80 of your ESP32.

@AndrewJ, can you try this version if the OSError 128 is also popping up? If it does, i'll compile a special version for you.

This will be the LAST alpha version, the next version will be the first BETA version. The beta version is stable enough for everyone to download, initially it will be binary only. When the code is stable enough, it will become a github repository.

Attached is the protocol and plugin source code. Beware that they might be changed in the next releases.
Attachments
protocols_plugins.zip
(7.33 KiB) Downloaded 814 times

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: uPyEasy

#98 Post by grovkillen » 19 Dec 2017, 21:50

Great news Lisa!
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

TD-er
Core team member
Posts: 8752
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: uPyEasy

#99 Post by TD-er » 20 Dec 2017, 09:39

Hmm, that sounds great and quite quick development as you're already approaching beta status.

I will try it myself also during the holidays. The ESP32's are already "in stock" :)

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

Re: uPyEasy

#100 Post by AndrewJ » 20 Dec 2017, 17:55

Thanks, Lisa. Excellent work! :D
I'll give the new version a try on my Doit board and I'll let you know about oserror 128.
Since the previous alpha I've received a Wemos Lolin Lite ESP32. I'll try that as well.
Cheers
AndrewJ

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

Re: uPyEasy

#101 Post by AndrewJ » 20 Dec 2017, 20:56

Just tried the latest version from Google Drive on my DOIT Devboard V1. I temporarily removed security on my wireless network to allow it to connect.

Unfortunately still getting errors a few seconds after restart. This is from the log after the long series of startup messages....

* Running on http://0.0.0.0:80/
2000-01-01T00:00:09.005 [debug] uPyEasy-uPyEasy: Protocols: Async processing protocols
2000-01-01T00:00:09.005 [debug] uPyEasy-uPyEasy: Plugins: Async processing plugins
Traceback (most recent call last):
File "boot.py", line 2, in <module>
File "upyeasy/__init__.py", line 57, in main
File "picoweb/__init__.py", line 240, in run
File "uasyncio/core.py", line 127, in run_forever
File "uasyncio/core.py", line 88, in run_forever
File "uasyncio/__init__.py", line 241, in start_server
OSError: 128
OSError: [Errno 2] ENOENT
MicroPython v1.9.3-181-g02d2a0f-dirty on 2017-12-19; ESP32 module with ESP32
Type "help()" for more information.

Actually two OSErrors this time! :( :(
Hope the above info helps.
As with the earlier version, I see the ESP32 with an IP address in my router, so its "nearly" working.

BTW I have noticed that it says "* Running on http://0.0.0.0:80/" - this IP address puzzles me a bit (probably an ignorant question).

If you have time to make a special firmware version to get round this, I'd be most grateful.

I haven't checked it on my Wemos LOLIN LITE yet. I'll try to do that later this evening.
Cheers,
AndrewJ

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

Re: uPyEasy

#102 Post by LisaM » 20 Dec 2017, 21:06

AndrewJ wrote: 20 Dec 2017, 17:55 Thanks, Lisa. Excellent work! :D
I'll give the new version a try on my Doit board and I'll let you know about oserror 128.
Since the previous alpha I've received a Wemos Lolin Lite ESP32. I'll try that as well.
Cheers
AndrewJ
I'm waiting for the ordered Lolin32 Pro, it has the ESP32-WROVER module with 4MB PsRam, Bluetooth and SD card.
I'm working on including bluetooth, SD card and thread based support functionality in uPyEasy. I'll have everything running on one core and all plugins on another, performance should be awesome then. For latency the pyboard will be much better, for functionality the ESP32. With 4MB PsRam stack and heap space are no longer an issue and lots of new functionality will be possible. All of this is costing $9!
Many sensor already have python drivers, so make them should be simple. I've tried to make the plugin and protocol coding as simple and reliable as possible, it should be very easy to convert existing plugin/protocol code to uPyEasy.
Scripting is also something i'm working on, plan is to have the first scripting possible at the first beta.

I'm also working on the python driver for grovkillen's senseair co2 measuring device, i'll need that for a prototype hardware device i'm developing for the business markets.

Besides all of this, i also have a very busy job as (the only) Data Architect for the largest insurance corporation here.. Sometimes it's hard to balance all of this, so please have some patience if development progress is slow at some weeks.. ;)

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

Re: uPyEasy

#103 Post by AndrewJ » 20 Dec 2017, 21:08

Just gave it a try on the Wemos LOLIN LITE.

Unfortunately, I get the same two errors, 128 then 2/ENOENT :(

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

Re: uPyEasy

#104 Post by LisaM » 20 Dec 2017, 21:13

AndrewJ wrote: 20 Dec 2017, 20:56 Just tried the latest version from Google Drive on my DOIT Devboard V1. I temporarily removed security on my wireless network to allow it to connect.

Unfortunately still getting errors a few seconds after restart. This is from the log after the long series of startup messages....

* Running on http://0.0.0.0:80/
2000-01-01T00:00:09.005 [debug] uPyEasy-uPyEasy: Protocols: Async processing protocols
2000-01-01T00:00:09.005 [debug] uPyEasy-uPyEasy: Plugins: Async processing plugins
Traceback (most recent call last):
File "boot.py", line 2, in <module>
File "upyeasy/__init__.py", line 57, in main
File "picoweb/__init__.py", line 240, in run
File "uasyncio/core.py", line 127, in run_forever
File "uasyncio/core.py", line 88, in run_forever
File "uasyncio/__init__.py", line 241, in start_server
OSError: 128
OSError: [Errno 2] ENOENT
MicroPython v1.9.3-181-g02d2a0f-dirty on 2017-12-19; ESP32 module with ESP32
Type "help()" for more information.

Actually two OSErrors this time! :( :(
Hope the above info helps.
As with the earlier version, I see the ESP32 with an IP address in my router, so its "nearly" working.

BTW I have noticed that it says "* Running on http://0.0.0.0:80/" - this IP address puzzles me a bit (probably an ignorant question).

If you have time to make a special firmware version to get round this, I'd be most grateful.

I haven't checked it on my Wemos LOLIN LITE yet. I'll try to do that later this evening.
Cheers,
AndrewJ
Line 214 is:

Code: Select all

s2, client_addr = s.accept()
The 0.0.0.0 is ok, it means any available ip-address.
Can you send the entire log?

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

Re: uPyEasy

#105 Post by LisaM » 20 Dec 2017, 21:29

AndrewJ wrote: 20 Dec 2017, 21:08 Just gave it a try on the Wemos LOLIN LITE.

Unfortunately, I get the same two errors, 128 then 2/ENOENT :(
New version on google drive, can you load that one in the ESP32?
After the error do:
>>> Import uos
>>> uos.remove('boot.py')

Then power cycle.

After reboot, on repl prompt:
>>> import wstest

And let me know what happens... ;)

Ps wstest.py is just this test program:

Code: Select all

import socket
from machine import Pin

#led_pin = Pin(5, Pin.OUT)

CONTENT = """\
HTTP/1.0 200 OK
Content-Type: text/html

<html>
  <head>
  </head>
  <body>
    <p>Hello #%d from MicroPython!</p>
    <a href="/toggle">Click here to toggle LED hooked to pin 5</a>
  </body>
</html>
"""

def main():
    s = socket.socket()
    ai = socket.getaddrinfo("0.0.0.0", 80)
    print("Bind address info:", ai)
    addr = ai[0][-1]

    s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
    s.bind(addr)
    s.listen(5)
    print("Listening, connect your browser to http://<this_host>:80/")

    counter = 0
    while True:
        sock, addr = s.accept()
        print("Client address:", addr)
        stream = sock.makefile("rwb")
        req = stream.readline().decode("ascii")
        method, path, protocol = req.split(" ")
        print("Got", method, "request for", path)
        if path == "/toggle":
            led_pin.value(1-led_pin.value())
        while True:
            h = stream.readline().decode("ascii").strip()
            if h == "":
                break
            print("Got HTTP header:", h)
        stream.write((CONTENT % counter).encode("ascii"))
        stream.close()
        sock.close()
        counter += 1
        print()

main() # Press Ctrl-C to stop web server

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

Re: uPyEasy

#106 Post by AndrewJ » 20 Dec 2017, 23:03

Hi Lisa,
Ok, I followed the steps
LisaM wrote: 20 Dec 2017, 21:29 New version on google drive, can you load that one in the ESP32?
After the error do:
>>> Import uos
>>> uos.remove('boot.py')
After reboot, on repl prompt:
>>> import wstest
and I got
I (26302) modsocket: Initializing
Bind address info: [(2, 1, 0, '0.0.0.0', ('0.0.0.0', 80))]
Listening, connect your browser to http://<this_host>:80/

Not sure what to make of this...
In my router, I'm not seeing the ESP32 now. (even with wireless security disabled again).
Think I'm missing something but not sure what.

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

Re: uPyEasy

#107 Post by LisaM » 21 Dec 2017, 00:46

Hi Andrew,

Very interesting, because the test program is doing exactly the same as uPyEasy:
wstest:

Code: Select all

sock, addr = s.accept()
uPyEasy (actually uasyncio):

Code: Select all

s2, client_addr = s.accept()
So, something is different because of the uasyncio error at line 241. I'll read some docs to find out what the difference is.
Can you get me a complete log?

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

Re: uPyEasy

#108 Post by AndrewJ » 21 Dec 2017, 09:04

Can you get me a complete log?
Having trouble attaching file here. It keeps saying invalid extension. I'll email it to you.
AndrewJ

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

Re: uPyEasy

#109 Post by LisaM » 21 Dec 2017, 10:22

AndrewJ wrote: 21 Dec 2017, 09:04
Can you get me a complete log?
Having trouble attaching file here. It keeps saying invalid extension. I'll email it to you.
AndrewJ
Got it, uPyEasy does get an ip address so that should be no problem. Looking into it.

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

Re: uPyEasy

#110 Post by LisaM » 22 Dec 2017, 13:12

AndrewJ wrote: 20 Dec 2017, 23:03 Hi Lisa,
Ok, I followed the steps
LisaM wrote: 20 Dec 2017, 21:29 New version on google drive, can you load that one in the ESP32?
After the error do:
>>> Import uos
>>> uos.remove('boot.py')
After reboot, on repl prompt:
>>> import wstest
and I got
I (26302) modsocket: Initializing
Bind address info: [(2, 1, 0, '0.0.0.0', ('0.0.0.0', 80))]
Listening, connect your browser to http://<this_host>:80/

Not sure what to make of this...
In my router, I'm not seeing the ESP32 now. (even with wireless security disabled again).
Think I'm missing something but not sure what.
This is my ESP32 testmachine: https://nl.aliexpress.com/item/Official ... 21054.html
Isn't that the same as your ESP32?

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

Re: uPyEasy

#111 Post by AndrewJ » 22 Dec 2017, 17:44

This is my ESP32 testmachine: https://nl.aliexpress.com/item/Official ... 21054.html
Isn't that the same as your ESP32?
Yes, it looks the same as mine. Yours could possibly be a different version of the ESP32 chip if it is recently purchased. Mine was bought about 6 months ago, also from Aliexpress.
The chip version shows when you do an erase or download to it, when it detects the chip type. Mine is ESP32DOWDQ6 (revision 0). I think I have read somewhere that there is a revision 1 about by now.

Have you already received your ESP32 or is it in transit?

Cheers
AndrewJ

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

Re: uPyEasy

#112 Post by LisaM » 22 Dec 2017, 20:53

AndrewJ wrote: 22 Dec 2017, 17:44
This is my ESP32 testmachine: https://nl.aliexpress.com/item/Official ... 21054.html
Isn't that the same as your ESP32?
Yes, it looks the same as mine. Yours could possibly be a different version of the ESP32 chip if it is recently purchased. Mine was bought about 6 months ago, also from Aliexpress.
The chip version shows when you do an erase or download to it, when it detects the chip type. Mine is ESP32DOWDQ6 (revision 0). I think I have read somewhere that there is a revision 1 about by now.

Have you already received your ESP32 or is it in transit?

Cheers
AndrewJ
I have these 3:
https://www.aliexpress.com/item/Officia ... 21054.html -> Chip is ESP32D0WDQ6 (revision 1)
https://www.aliexpress.com/item/ESP32-B ... 25963.html
https://nl.aliexpress.com/item/LOLIN32- ... 82537.html

With the last one, the Lolin32, is on it's way to me. The Lolin32 has 4MB PsRam, so uPyEasy could then also run in ram instead of flash.
uPyEasy wil support all if not most ESP32 version, including ssd1306 en the ILI9341 touch tft screen.

What's the second ESP32 chip version you have?

One way or another, we will fix this... ;)

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

Re: uPyEasy

#113 Post by AndrewJ » 22 Dec 2017, 21:42

What's the second ESP32 chip version you have?
It's a Wemos LOLIN LITE32 (v1.0.0) board (seems to be a cut-down LOLIN32 with less GPIOs exposed).
https://www.aliexpress.com/item/WEMOS-L ... 0.0.DIgzf6
This apparently comes with Micropython loaded - but I didn't realise until -after- I'd erased and loaded upyeasy!
Chip is ESP32DOWDQ6 (revision 1).
One way or another, we will fix this... ;)
Absolutely. I'll be glad to help any way I can. I can certainly do more testing when you are ready, and I'm keen to learn Micropython too, although I'm starting from ground zero.

Best regards
AndrewJ

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

Re: uPyEasy

#114 Post by LisaM » 22 Dec 2017, 23:39

AndrewJ wrote: 22 Dec 2017, 21:42 I'm keen to learn Micropython too, although I'm starting from ground zero.
Python is King of the Hill: https://www.ibm.com/developerworks/comm ... ce?lang=en

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

Re: uPyEasy

#115 Post by LisaM » 22 Dec 2017, 23:44

AndrewJ wrote: 22 Dec 2017, 21:42 Chip is ESP32DOWDQ6 (revision 1).
The already installed ESP32 micropython version was probably an old one, they migrated the ESP32 micropython branch back into the master branch just a week ago and the master branch is the one we're using. ;)
Since the chip is the same, the OSError 128 error shouldn't happen... Continuing search...

Admin
Site Beheer
Posts: 9
Joined: 14 Apr 2015, 20:54

Re: uPyEasy

#116 Post by Admin » 23 Dec 2017, 09:22

Topic moved to dedicated uPyEasy subforum

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

Re: uPyEasy

#117 Post by LisaM » 23 Dec 2017, 15:33

Hi Andrew,

Shall we continue at viewtopic.php?f=22&t=3906 for your ESP32?

Cheers,

Lisa

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

Re: uPyEasy

#118 Post by AndrewJ » 23 Dec 2017, 20:48

Yes, it's good to have a dedicated area of the forum for uPyEasy :)

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

Re: uPyEasy

#119 Post by karl222 » 06 Jan 2018, 20:28

hey guys,

many thanks for your great efforts bringing espeasy to the next Level!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

As I am not a pro on all that stuff I would appreciate having a FlashESPxxx tool as with ESP Mega in order to install upyeasy...

Maybe you did already and I am just too dumb to have it seen.

many thanks, great work!
karl

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

Re: uPyEasy

#120 Post by LisaM » 06 Jan 2018, 20:40

karl222 wrote: 06 Jan 2018, 20:28 hey guys,

many thanks for your great efforts bringing espeasy to the next Level!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

As I am not a pro on all that stuff I would appreciate having a FlashESPxxx tool as with ESP Mega in order to install upyeasy...

Maybe you did already and I am just too dumb to have it seen.

many thanks, great work!
karl
Tool & instructions: viewtopic.php?f=22&t=3906

Post Reply

Who is online

Users browsing this forum: No registered users and 23 guests