Page 2 of 3

Re: uPyEasy

Posted: 21 Oct 2017, 19:51
by LisaM
grovkillen wrote: 21 Oct 2017, 13:15 Lisa will release this when it is mature enough. She only use this thread to show current status and get feedback.
+10!

Re: uPyEasy

Posted: 21 Oct 2017, 20:39
by LisaM
BertB wrote: 21 Oct 2017, 12:27 This is a realy great development.
But, I wonder how Easy it will be in the end to setup and use.
I also wonder how 'high speed' or 'real time' modules are handled.
And how portable modules will be across the various platforms. Will it be possible to develop a DS1820 module that can be uses on all platforms and if no, how does one cope with the differences.
uPyEasy uses the micropython hardware API: https://github.com/micropython/micropyt ... rdware-API
So far i haven't encountered any differences between esp8266 wifi and esp32 wifi, also the onboard led is reacting exactly the same on the pyboard and the esp32 (uPyEasy active: led on, uPyEasy not active (crash for example): led off). I haven't had enough experience with all platforms to be 100% sure, but so far it looks promising.

The ds1820 module will be part of the first beta's, simply because it's currently already available on all platforms as an micropython program. Due to the micropython hardware api, there are no differences from a micropython program viewpoint which uPyEasy is.

Initial setup is described in a earlier post, it does work exactly like that. Tested on pyboard and esp32, linux network settings cannot be changed directly from micropython, and it works.

I believe the speed will be more then enough for it's purpose, also because of the async nature of uPyEasy. To give an impression of the speed, i have attached a screen capture video of all three platforms.

Like grovkillen said before, i'm showing this so that you can take a look at the build in progress and give me feedback concerning what uPyEasy is capable of. I'm building in a continuous pace, beginning with the UI which is the backbone. If that works on all platforms using the same code base (which is what it currently does) then it's time for a next step. I'll bake a few firmware's for you guys to play with (since it's only the UI, nothing else can be done with it).

Re: uPyEasy

Posted: 22 Oct 2017, 09:40
by BertB
Thank you LisaM.
Do you think there will be room for something as easy as Rules?
I can imagine scripting is much more powerfull, but it looks like learning a new complex-ish language.

Re: uPyEasy

Posted: 22 Oct 2017, 12:55
by LisaM
BertB wrote: 22 Oct 2017, 09:40 Thank you LisaM.
Do you think there will be room for something as easy as Rules?
I can imagine scripting is much more powerfull, but it looks like learning a new complex-ish language.
How about an example script that resembles the old rules script as close as possible? It will basically act as a template for rule based scripting, simple but leaving the option open of making it complex. Will something like that help you?

For example this old rule part:

Code: Select all

On TurnOn do
    gpio,12,1
EndOn
will be turned into this:

Code: Select all

if TurnOn:
    gpio (12,1)
endif

Re: uPyEasy

Posted: 22 Oct 2017, 14:48
by BertB
It sure does.

Re: uPyEasy

Posted: 22 Oct 2017, 15:03
by LisaM
As you maybe have seen in the uPyEasy movie, the dates in uPyEasy are wrong. That is because NTP isn't implemented yet, the default manufacturing date is used, so i put it on my short list for now. Also syslog is a desire of mine, since uPyEasy starts to generate more and more debug log messages which scroll of the screen. Syslog also put on my todo short list.

Working on the tools tab, i noticed that the 'advanced' subtab size is spiraling out of control, so i have put it in a separate main tab:
upyeasy advanced.JPG
upyeasy advanced.JPG (31.71 KiB) Viewed 73482 times

Re: uPyEasy

Posted: 22 Oct 2017, 22:31
by AndrewJ
This is a really interesting development, keep the updates coming please! :)
I like the idea of examples of old and new rules/scripts. A range of complexity would be good, going from the simple to the more advanced. That's if time allows!

Re: uPyEasy

Posted: 23 Oct 2017, 18:39
by toffel969
BertB wrote: 22 Oct 2017, 14:48It sure does.
+1 on that, got so used to the rules engines with all its limitations and features :-)

Re: uPyEasy

Posted: 23 Oct 2017, 18:46
by LisaM
toffel969 wrote: 23 Oct 2017, 18:39 +1 on that, got so used to the rules engines with all its limitations and features :-)
The rules will still be there, the limitations are gone. The number of features will be almost limitless, only the limits imposed by micropython will apply.
It also means that crashing uPyEasy will be much easier, you have full access to the database, so handle with care...

Re: uPyEasy

Posted: 29 Oct 2017, 02:18
by LisaM
Added extensive logging: console, weblog and syslog logging is added. It's also flexible, more logging channels can be added through an additional 'sink'. All log messages are broadcasted on all channels at the same time.
Logging levels are: off, debug, info, warning and error.
upyeasy advanced.JPG
upyeasy advanced.JPG (153.43 KiB) Viewed 73121 times
Syslog in synology:
upyeasy syslog.JPG
upyeasy syslog.JPG (67.74 KiB) Viewed 73121 times
Weblog, the number of lines is adjustable for memory reasons:
upyeasy.JPG
upyeasy.JPG (414.02 KiB) Viewed 73121 times
NTP protocol is also added, timezone/dst is done manually due to memory reasons.

Hardware page now has i2c/spi/uart sections, if these reserve Dx's the Dx is no longer available and grayed out.
upyeasy hw dxpin.jpg
upyeasy hw dxpin.jpg (146.43 KiB) Viewed 73121 times
On the same hardware page, the pins can be configure to 7 pin state's:
upyeasy pinmode.JPG
upyeasy pinmode.JPG (138.72 KiB) Viewed 73117 times
The pin state's can be looked at in the tools/dx pin status menu choice:
upyeasy pin.JPG
upyeasy pin.JPG (143.24 KiB) Viewed 73118 times

Re: uPyEasy

Posted: 29 Oct 2017, 09:34
by frank
this looks great i hope that we can download the first test version soon :D

Re: uPyEasy

Posted: 29 Oct 2017, 12:33
by LisaM
frank wrote: 29 Oct 2017, 09:34 this looks great i hope that we can download the first test version soon :D
I'm working towards the first test version, a couple of weeks left. Like i've said before, it will only contain the UI parts and is mainly for others to test to see if the program holds up in other environments then my testbeds. The first two platforms will be for pyboard+w5500 and the esp32. The nodemcu will require more testing because of the very tight free heap size, the free flash and stack size won't be a problem. If the free heap size is getting to small, i'll need to do some optimization first.

Re: uPyEasy

Posted: 09 Nov 2017, 14:37
by LisaM
Protocols (domoticz http and domoticz mqtt) & Plugins (gpio & dht) are now loaded automatically, no code changes needed (other then adding/deleting the filename from an __init__.py file).
It's still using a single code base, all images are using the same uPyEasy code. The GUI is now stable and identical for all platforms.
I have 3 images to play with if you're interested, it's still GUI only although the protocols & plugins are actually loaded. Please let me know if you want one (with the condition that you let know if it works ;) )
Please PM me if you want the image

The images are:
  • Orange Pi Zero (H2)
    Pyboard (stm32 port)
    ESP32
Like said before, i'm focusing on the big boys here because there is a fine solution for the very small soc's (ESPEasy on ESP-01). Also because the big boys are the future, in the near future the ESP32 will be as expensive as the NodeMCU (esp-13), why buy the nodemcu then if the ESP32 is a LOT faster?
I will make a NodeMCU/Sonoff version, probably trimmed to make it fit in the very limited space available, as soon as the other ports are stable and fully functional.
The Orange Pi Zero is 10$ device which continues to amaze me, it's running armbian and very very fast.

Please note that the image is an pre-alpha version, without pin functionality, mainly to test if it works on your soc!

Re: uPyEasy

Posted: 09 Nov 2017, 14:57
by Drum
I would love to try the ESP32 image. ;)

Re: uPyEasy

Posted: 09 Nov 2017, 15:02
by adampr1
and me :)
ESP32 and Orange Pi Zero

B.R., Gruß,
Adam

Re: uPyEasy

Posted: 09 Nov 2017, 18:09
by frank
for me the Pyboard (stm32 port) version

Re: uPyEasy

Posted: 09 Nov 2017, 18:44
by legalo
for me
ESP32 and Orange Pi Zero

please thanks. :D

Re: uPyEasy

Posted: 15 Nov 2017, 03:43
by budman1758
I too would like a OrangePi Zero and an ESP32 version. Thanks!! :mrgreen:

Re: uPyEasy

Posted: 15 Nov 2017, 12:49
by BertB
Is the Orange pi zero better than the Raspberry pi zero?

Re: uPyEasy

Posted: 15 Nov 2017, 13:51
by LisaM
BertB wrote: 15 Nov 2017, 12:49 Is the Orange pi zero better than the Raspberry pi zero?
Better? That's a subjective opinion, here's an objective comparison:
https://www.board-db.org/compare/139,158/

My reasons to buy the Orange Pi Zero:
  • Ethernet
  • Bluetooth
  • Cheaper (compared with the raspberry pi zero W)

Re: uPyEasy

Posted: 15 Nov 2017, 15:25
by BertB
My zero has onboard wifi and bluetooth and had a price of 11 euro.

Re: uPyEasy

Posted: 15 Nov 2017, 15:59
by LisaM
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

Re: uPyEasy

Posted: 16 Nov 2017, 07:13
by budman1758
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:

Re: uPyEasy

Posted: 16 Nov 2017, 20:15
by LisaM
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.

Re: uPyEasy

Posted: 17 Nov 2017, 22:51
by BertB
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

Re: uPyEasy

Posted: 18 Nov 2017, 00:03
by LisaM
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.

Re: uPyEasy

Posted: 19 Nov 2017, 12:59
by BertB
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.

Re: uPyEasy

Posted: 08 Dec 2017, 19:34
by LisaM
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.

Re: uPyEasy

Posted: 08 Dec 2017, 20:24
by grovkillen
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!

Re: uPyEasy

Posted: 09 Dec 2017, 12:19
by AndrewJ
Great work, thanks for the update. Good luck with fixing the ESP32 bug!

Re: uPyEasy

Posted: 10 Dec 2017, 02:12
by LisaM
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.

Re: uPyEasy

Posted: 10 Dec 2017, 22:38
by AndrewJ
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

Re: uPyEasy

Posted: 10 Dec 2017, 23:44
by CHK_BLN
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

Re: uPyEasy

Posted: 10 Dec 2017, 23:53
by LisaM
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

Re: uPyEasy

Posted: 11 Dec 2017, 00:50
by LisaM
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.

Re: uPyEasy

Posted: 11 Dec 2017, 10:08
by AndrewJ
Hi Lisa, this alpha tester could be me ... I'll pm you.
AndrewJ

Re: uPyEasy

Posted: 11 Dec 2017, 21:50
by CHK_BLN
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

Re: uPyEasy

Posted: 12 Dec 2017, 00:09
by LisaM
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

Re: uPyEasy

Posted: 12 Dec 2017, 19:48
by AndrewJ
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.

Re: uPyEasy

Posted: 12 Dec 2017, 22:45
by CHK_BLN
Hi Lisa
your help worked.
But after a reboot the settings are lost.
Best regards

Re: uPyEasy

Posted: 12 Dec 2017, 22:59
by AndrewJ
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

Re: uPyEasy

Posted: 13 Dec 2017, 01:15
by LisaM
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

Re: uPyEasy

Posted: 13 Dec 2017, 13:26
by AndrewJ
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

Re: uPyEasy

Posted: 13 Dec 2017, 13:30
by AndrewJ
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

Re: uPyEasy

Posted: 13 Dec 2017, 13:42
by LisaM
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.

Re: uPyEasy

Posted: 13 Dec 2017, 18:07
by AndrewJ
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

Re: uPyEasy

Posted: 19 Dec 2017, 21:11
by LisaM
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.

Re: uPyEasy

Posted: 19 Dec 2017, 21:50
by grovkillen
Great news Lisa!

Re: uPyEasy

Posted: 20 Dec 2017, 09:39
by TD-er
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" :)

Re: uPyEasy

Posted: 20 Dec 2017, 17:55
by AndrewJ
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