STM32 boards

Moderators: Voyager, BertB, grovkillen, Stuntteam, LisaM

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

STM32 boards

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

Firmware status: Beta
Firmware version: v0.2.0

For the PyBv3 with STM32F405 board:

BOM (Bill Of Materials): Wiring between Pyboard and W5500:
MOSI connected to PA7
MISO connected to PA6
SCLK connected to PA5
nSS connected to PA4
nRESET connected to PA3
Firmware upload instructions

Download the dfu-util tool here: http://dfu-util.sourceforge.net/

The uPyEasy FLASHBINARY file has this format: upyeasy_vXX_YYYYMMDD_test_esp32_2048.bin and is attached to this post as zip file.
The (latest) uPyEasy binary files can be downloaded here: https://github.com/letscontrolit/upyeasy/releases

Run this in REPL:
import pyb
pyb.bootloader()
Then you're kicked out of REPL due to boot mode.

Run this:
LINUX: sudo dfu-util --alt 0 -D upyeasy-pybv3.dfu
WINDOWS: dfu-util --alt 0 -D upyeasy-pybv3.dfu
After flashing the firmware, the dfu-util tool will reboot your pyboard.
After reboot, uPyEasy will auto-start.

If you have connected a W5500 as described above, no other steps are needed because uPyEasy is using DHCP to get the ip-address.
uPyEasy should be running on default port 80, so connect using your browser using: http://<your upyeasy ip address>:80

In linux you can use the following command to connect to the STM32: screen /dev/ttyACMx 115200,cs8
In Windows just use putty to connect to the com port COMx at 115200 baud speed.
If you have wired the W5500 otherwise, you'll get this message (or get stuck at Network init, then press ctrl-c):

Code: Select all

Exiting: Network not available, set network values!
Now, you'll need to set the correct parameters in REPL:

Code: Select all

upyeasy.setnet(<spi number>,'<machine pin nss>','<machine pin rst>')
And in the case of above wiring, it would be upyeasy.setnet(1,'A3','A4')
Then reboot using:

Code: Select all

import machine
machine.reset()
The uPyEasy webserver response is about 10x faster then the ESP32 WiFi response, due to the wired (1GB) network.

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

Re: STM32 boards

#2 Post by LisaM » 05 Jan 2018, 22:12

Version: v53

Fixed:
- Time on ESP32

Added:
- I2C
- BME280 sensor

Database changes:
- None
upyeasy v53.JPG
upyeasy v53.JPG (160.08 KiB) Viewed 89899 times

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

Re: STM32 boards

#3 Post by TD-er » 06 Jan 2018, 15:32

Just curious about the BME280.
Did you program this functionality yourself (inspired by the ESPeasy source), or was "import" the only thing you had to do to use it?
Is the recorded temperature in free air above what you would expect, compared to other thermometers in the same room?

I found it always very odd these sensors report a few degrees too hot.
I already noticed they heat up themselves, but still if I only read a fraction of the time and let them sleep the rest, the reported temperature is still too high.

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

Re: STM32 boards

#4 Post by LisaM » 06 Jan 2018, 19:55

TD-er wrote: 06 Jan 2018, 15:32 Just curious about the BME280.
Did you program this functionality yourself (inspired by the ESPeasy source), or was "import" the only thing you had to do to use it?
Is the recorded temperature in free air above what you would expect, compared to other thermometers in the same room?

I found it always very odd these sensors report a few degrees too hot.
I already noticed they heat up themselves, but still if I only read a fraction of the time and let them sleep the rest, the reported temperature is still too high.
I don't look at the ESPEasy source, uPyEasy does have it own PlugIn framework which is a lot easier to build onto. I just reused bme280 code from another project and copy-pasted it into this plugin. Code attached so you can take a look at it.

The temperature values measured are inside my 42HE rack cabinet and is what you can expect inside such a cabinet.

UPDATE: Plugin sources can be found here: https://github.com/letscontrolit/uPyEasy

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

Re: STM32 boards

#5 Post by TD-er » 06 Jan 2018, 20:51

Hmm, at first glance, the only difference is you read all data from the sensor at once.
I will try and look into that, since I find it very odd these sensors may read temperature values up to 5 degrees too high.
That's just weird.

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

Re: STM32 boards

#6 Post by LisaM » 01 Feb 2018, 18:32

LisaM wrote: 23 Dec 2017, 15:17 Firmware status: Beta
Firmware version: v593

For the PyBv3 with STM32F405 board:

BOM (Bill Of Materials): Wiring between Pyboard and W5500:
MOSI connected to PA7
MISO connected to PA6
SCLK connected to PA5
nSS connected to PA4
nRESET connected to PA3
Firmware upload instructions

Download the dfu-util tool here: http://dfu-util.sourceforge.net/

The uPyEasy FLASHBINARY file has this format: upyeasy_vXX_YYYYMMDD_test_esp32_2048.bin and is attached to this post as zip file.
The (latest) uPyEasy binary files can be downloaded here: https://github.com/letscontrolit/uPyEas ... r/Releases

Run this in REPL:
import pyb
pyb.bootloader()
Then you're kicked out of REPL due to boot mode.

Run this:
LINUX: sudo dfu-util --alt 0 -D upyeasy-pybv3.dfu
WINDOWS: dfu-util --alt 0 -D upyeasy-pybv3.dfu
After flashing the firmware, the dfu-util tool will reboot your pyboard.
After reboot, uPyEasy will auto-start.

If you have connected a W5500 as described above, no other steps are needed because uPyEasy is using DHCP to get the ip-address.
uPyEasy should be running on default port 80, so connect using your browser using: http://<your upyeasy ip address>:80

In linux you can use the following command to connect to the STM32: screen /dev/ttyACMx 115200,cs8
In Windows just use putty to connect to the com port COMx at 115200 baud speed.
If you have wired the W5500 otherwise, you'll get this message (or get stuck at Network init, then press ctrl-c):

Code: Select all

Exiting: Network not available, set network values!
Now, you'll need to set the correct parameters in REPL:

Code: Select all

upyeasy.setnet(<spi number>,'<machine pin nss>','<machine pin rst>')
And in the case of above wiring, it would be upyeasy.setnet(1,'A3','A4')
Then reboot using:

Code: Select all

import machine
machine.reset()
The uPyEasy webserver response is about 10x faster then the ESP32 WiFi response, due to the wired (1GB) network.

filipq
New user
Posts: 2
Joined: 02 Feb 2018, 01:22

Re: STM32 boards

#7 Post by filipq » 02 Feb 2018, 01:25

Hello

I have followed your instructions for STM32 board and getting below error message:

loaded sink log
loaded sink console
loaded sink syslog
2015-01-01T00:00:00.003 [debug] uPyEasy: Init: Init constructor
2015-01-01T00:00:00.003 [debug] uPyEasy: Init: Entering init
2015-01-01 00:00:00 [debug] uPyEasy: Init: Create directory config
2015-01-01 00:00:00 [debug] uPyEasy: Init: Create directory config exception: OSError(17,)
2015-01-01 00:00:00 [debug] uPyEasy: Init: Create directory plugins
2015-01-01 00:00:00 [debug] uPyEasy: Init: Create directory plugins exception: OSError(17,)
2015-01-01 00:00:00 [debug] uPyEasy: Init: Create directory protocols
2015-01-01 00:00:00 [debug] uPyEasy: Init: Create directory protocols exception: OSError(17,)
2015-01-01 00:00:00 [debug] uPyEasy: Init: Create directory scripts
2015-01-01 00:00:00 [debug] uPyEasy: Init: Create directory scripts exception: OSError(17,)
2015-01-01 00:00:00 [debug] uPyEasy: Init: Create directory rules
2015-01-01 00:00:00 [debug] uPyEasy: Init: Create directory rules exception: OSError(17,)
2015-01-01 00:00:00 [debug] uPyEasy: Init: config Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: network Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: protocol Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: controller Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: hardware Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: dxpin Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: dxmap Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: plugin Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: pluginstore Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: device Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: service Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: notification Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: advanced Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: script Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: rule Table
2015-01-01 00:00:00 [debug] uPyEasy: Hal: Init
2015-01-01 00:00:00 [debug] uPyEasy: Hal: init, network record present
2015-01-01 00:00:00 [debug] uPyEasy: Hal: pyboard
2015-01-01 00:00:00 [debug] uPyEasy: Hal: board info
2015-01-01 00:00:00 [debug] uPyEasy: Hal: board pyboard
2015-01-01 00:00:00 [debug] uPyEasy: Hal: pyboard, spi is empty: trying default!

What does it mean?

Thanks
Filip

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

Re: STM32 boards

#8 Post by LisaM » 02 Feb 2018, 12:09

filipq wrote: 02 Feb 2018, 01:25 2015-01-01 00:00:00 [debug] uPyEasy: Hal: pyboard, spi is empty: trying default!
Hi Filip,

Is there more log available?

Cheers,

Lisa

filipq
New user
Posts: 2
Joined: 02 Feb 2018, 01:22

Re: STM32 boards

#9 Post by filipq » 02 Feb 2018, 15:09

Hi Lisa

That's all nothing else. Unless there is another way to get more logs of it. I am using board and ethernet card from the post above. Another thing is that I have to manually run it by running "import upyeasy" and then "upyeasy.main()" and then getting "[debug] uPyEasy: Hal: pyboard, spi is empty: trying default!" it wont start automatically.

Thanks
Filip

User avatar
micropet
Normal user
Posts: 34
Joined: 23 Jan 2018, 11:39
Location: Essen, Germany
Contact:

Re: STM32 boards

#10 Post by micropet » 05 Feb 2018, 13:33

Dear Lisa,

meanwhile I can compile under Linux the micropython for Linux and for the STM32 processors.

But I can not compile the upueasy version.

Could you possibly write a few words when you have time?

Greetings Peter

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

Re: STM32 boards

#11 Post by LisaM » 05 Feb 2018, 17:29

filipq wrote: 02 Feb 2018, 15:09 Hi Lisa

That's all nothing else. Unless there is another way to get more logs of it. I am using board and ethernet card from the post above. Another thing is that I have to manually run it by running "import upyeasy" and then "upyeasy.main()" and then getting "[debug] uPyEasy: Hal: pyboard, spi is empty: trying default!" it wont start automatically.

Thanks
Filip
Filip,

The boot.py is probably not adjusted, can you edit the boot.py using the usb share?
Just add to the end:
import upyeasy
upyeasy.main()

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

Re: STM32 boards

#12 Post by LisaM » 05 Feb 2018, 17:35

micropet wrote: 05 Feb 2018, 13:33 Dear Lisa,

meanwhile I can compile under Linux the micropython for Linux and for the STM32 processors.

But I can not compile the upueasy version.

Could you possibly write a few words when you have time?

Greetings Peter
Rename the modules directory in the STM32 directory to modules.old
Unpack the attached modules zip file so you have a complete new modules subdir (including uPyEasy).
set BOARD=PYBV3 in Makefile (STM32 dir)
run this command: make MICROPY_PY_WIZNET5K=5500 BOARD=PYBV3 deploy
This will build AND deploy the firmware!

Cheers,

Lisa
Attachments
modules.zip
(167.59 KiB) Downloaded 716 times

User avatar
micropet
Normal user
Posts: 34
Joined: 23 Jan 2018, 11:39
Location: Essen, Germany
Contact:

Re: STM32 boards

#13 Post by micropet » 05 Feb 2018, 18:51

Thank you Lisa,

that takes me a big step further.
The pyboard v1.1 does not boot anymore.
An STM32F4VE boots.

On the STM32F4VE board is also a W5500 connected. With normal micropython I come with it in my network.
I am not sure if the W5500 driver is loaded now.
Or on which IP the board is running.

The following messages come:

import upyeasy
>>> upyeasy.main()
loaded sink log
loaded sink console
loaded sink syslog
2000-01-01T00:00:00.000 [debug] uPyEasy: Init: Init constructor
2000-01-01T00:00:00.000 [debug] uPyEasy: Init: Entering init
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create directory config
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create directory plugins
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create directory protocols
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create directory scripts
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create directory rules
2000-01-01 00:00:00 [debug] uPyEasy: Init: config Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: network Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: protocol Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: controller Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: hardware Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: dxpin Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: dxmap Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: plugin Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: pluginstore Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: device Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: service Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: notification Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: advanced Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: script Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: rule Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create Config Record
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create Network Record
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create Hardware Record
2000-01-01 00:00:00 [debug] uPyEasy: Hal: hardwaredb init
2000-01-01 00:00:00 [debug] uPyEasy: Hal: hardwaredb pyboard
2000-01-01 00:00:00 [debug] uPyEasy: Hal: board info
2000-01-01 00:00:00 [debug] uPyEasy: Hal: board pyboard
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create dxpin Record
2000-01-01 00:00:00 [debug] uPyEasy: Hal: dxpins_init
2000-01-01 00:00:00 [debug] uPyEasy: Hal: dxpins_init pyboard
2000-01-01 00:00:00 [debug] uPyEasy: Hal: board info
2000-01-01 00:00:00 [debug] uPyEasy: Hal: board pyboard
2000-01-01 00:00:00 [debug] uPyEasy: STM32: init_pindb
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create advanced Record
2000-01-01 00:00:00 [debug] uPyEasy: Hal: Init
2000-01-01 00:00:00 [debug] uPyEasy: Hal: init, network record present
2000-01-01 00:00:00 [debug] uPyEasy: Hal: pyboard
2000-01-01 00:00:00 [debug] uPyEasy: Hal: board info
2000-01-01 00:00:00 [debug] uPyEasy: Hal: board pyboard
2000-01-01 00:00:00 [debug] uPyEasy: Hal: pyboard, spi is empty: trying default!
2000-01-01 00:00:00 [debug] uPyEasy: Hal: pyboard, spi is empty: no default setup!
2000-01-01 00:00:00 [debug] uPyEasy: Protocols: Load
2000-01-01 00:00:00 [debug] uPyEasy: Protocols: Init protocol records
2000-01-01 00:00:00 [debug] uPyEasy: Protocols: Load protocol domoticz_mqtt
2000-01-01 00:00:00 [debug] uPyEasy: Protocols: Create protocol Record: domoticz_mqtt
2000-01-01 00:00:00 [debug] uPyEasy: Protocols: Load protocol domoticz_http
2000-01-01 00:00:00 [debug] uPyEasy: Protocols: Create protocol Record: domoticz_http
2000-01-01 00:00:00 [debug] uPyEasy: Protocols: Init protocol records, run async loop
2000-01-01 00:00:00 [debug] uPyEasy: Plugins: Load
2000-01-01 00:00:00 [debug] uPyEasy: Plugins: init plugin records
2000-01-01 00:00:00 [debug] uPyEasy: Plugins: Register frozen plugin switch
2000-01-01 00:00:00 [debug] uPyEasy: Plugin: switch contruction
2000-01-01 00:00:00 [debug] uPyEasy: Plugins: Create frozen plugin Record: switch
2000-01-01 00:00:00 [debug] uPyEasy: Plugins: Register frozen plugin bme280
2000-01-01 00:00:00 [debug] uPyEasy: Plugins: Create frozen plugin Record: bme280
2000-01-01 00:00:00 [debug] uPyEasy: Plugins: Register frozen plugin test
2000-01-01 00:00:00 [debug] uPyEasy: Plugins: Create frozen plugin Record: test
2000-01-01 00:00:00 [debug] uPyEasy: Plugins: Register frozen plugin ds18
2000-01-01 00:00:00 [debug] uPyEasy: Plugin: ds18 contruction
2000-01-01 00:00:00 [debug] uPyEasy: Plugins: Create frozen plugin Record: ds18
2000-01-01 00:00:00 [debug] uPyEasy: Plugins: Init plugin records, run async loop
2000-01-01 00:00:00 [debug] uPyEasy: Scripts: Load
2000-01-01 00:00:00 [debug] uPyEasy: Scripts: Init
2000-01-01 00:00:00 [debug] uPyEasy: Plugins: GetQueue
2000-01-01 00:00:00 [debug] uPyEasy: Scripts: init scripts records
2000-01-01 00:00:00 [debug] uPyEasy: Scripts: init rules records
2000-01-01 00:00:00 [debug] uPyEasy: Scripts: Init script/rule records, run async loop
2000-01-01 00:00:00 [debug] uPyEasy: Utils: Sys hostname
2000-01-01 00:00:00 [debug] uPyEasy: Utils: uPyEasy Name
Set syslog hostname 0.0.0.0
reloaded sink syslog
2000-01-01 00:00:00 [debug] uPyEasy-uPyEasy: Hal: Entering SetTime
2000-01-01 00:00:00 [debug] uPyEasy-uPyEasy: Hal: Entering GetNtpTime
2000-01-01 00:00:00 [debug] uPyEasy-uPyEasy: Hal: network Table
2000-01-01 00:00:00 [debug] uPyEasy-uPyEasy: Hal: Using NTP Hostname: pool.ntp.org
2000-01-01 00:00:00 [debug] uPyEasy-uPyEasy: Hal: TimeZome offset: 60

User avatar
micropet
Normal user
Posts: 34
Joined: 23 Jan 2018, 11:39
Location: Essen, Germany
Contact:

Re: STM32 boards

#14 Post by micropet » 05 Feb 2018, 19:34

I see after some Time:

2000-01-01 00:00:00 [debug] uPyEasy-uPyEasy: Hal: Received NTP Time: n.a.
Exiting: Network not available, set network values!

User avatar
micropet
Normal user
Posts: 34
Joined: 23 Jan 2018, 11:39
Location: Essen, Germany
Contact:

Re: STM32 boards

#15 Post by micropet » 06 Feb 2018, 09:15

So, next try.
With these commands I get into the network. The W5500 can also be pinged.

>>> import network
>>> nic = network.WIZNET5K(pyb.SPI(1), pyb.Pin.board.A4, pyb.Pin.board.A3)
>>> print(nic.ifconfig())
('192.168.0.210', '255.255.255.0', '192.168.0.3', '8.8.8.8')
>>> nic.isconnected()
True

With:
import upyeasy
upyeasy.main()

i get:

loaded sink log
loaded sink console
loaded sink syslog
2000-01-01T00:00:00.000 [debug] uPyEasy: Init: Init constructor
2000-01-01T00:00:00.000 [debug] uPyEasy: Init: Entering init
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create directory config
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create directory config exception: OSError(17,)
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create directory plugins
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create directory plugins exception: OSError(17,)
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create directory protocols
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create directory protocols exception: OSError(17,)
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create directory scripts
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create directory scripts exception: OSError(17,)
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create directory rules
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create directory rules exception: OSError(17,)
2000-01-01 00:00:00 [debug] uPyEasy: Init: config Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: network Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: protocol Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: controller Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: hardware Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: dxpin Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: dxmap Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: plugin Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: pluginstore Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: device Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: service Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: notification Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: advanced Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: script Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: rule Table
2000-01-01 00:00:00 [debug] uPyEasy: Hal: Init
2000-01-01 00:00:00 [debug] uPyEasy: Hal: init, network record present
2000-01-01 00:00:00 [debug] uPyEasy: Hal: pyboard
2000-01-01 00:00:00 [debug] uPyEasy: Hal: board info
2000-01-01 00:00:00 [debug] uPyEasy: Hal: board pyboard

Then nothing happens anymore.

I also tried the following:

upyeasy.setnet(1,'A3','A4')
Then reboot using:
import machine
machine.reset()

after boot:
import upyeasy
upyeasy.main()

#edit:
I think I exchanged A4 and A3.
with upyeasy.setnet (1, 'A4', 'A3') I get:

loaded sink log
loaded sink console
loaded sink syslog
2000-01-01T00:00:00.000 [debug] uPyEasy: Init: Init constructor
2000-01-01T00:00:00.000 [debug] uPyEasy: Init: Entering init
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create directory config
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create directory config exception: OSError(17,)
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create directory plugins
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create directory plugins exception: OSError(17,)
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create directory protocols
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create directory protocols exception: OSError(17,)
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create directory scripts
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create directory scripts exception: OSError(17,)
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create directory rules
2000-01-01 00:00:00 [debug] uPyEasy: Init: Create directory rules exception: OSError(17,)
2000-01-01 00:00:00 [debug] uPyEasy: Init: config Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: network Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: protocol Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: controller Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: hardware Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: dxpin Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: dxmap Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: plugin Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: pluginstore Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: device Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: service Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: notification Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: advanced Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: script Table
2000-01-01 00:00:00 [debug] uPyEasy: Init: rule Table
2000-01-01 00:00:00 [debug] uPyEasy: Hal: Init
2000-01-01 00:00:00 [debug] uPyEasy: Hal: init, network record present
2000-01-01 00:00:00 [debug] uPyEasy: Hal: pyboard
2000-01-01 00:00:00 [debug] uPyEasy: Hal: board info
2000-01-01 00:00:00 [debug] uPyEasy: Hal: board pyboard
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "upyeasy/__init__.py", line 40, in main
File "upyeasy/init.py", line 201, in init
File "upyeasy/hal.py", line 91, in init_network
AttributeError: 'WIZNET5K' object has no attribute 'active'


Do you have any idea?

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: STM32 boards

#16 Post by frank » 15 Feb 2018, 20:55

loaded sink log
loaded sink console
loaded sink syslog
2015-01-01T00:00:00.003 [debug] uPyEasy: Init: Init constructor
2015-01-01T00:00:00.003 [debug] uPyEasy: Init: Entering init
2015-01-01 00:00:00 [debug] uPyEasy: Init: Create directory config
2015-01-01 00:00:00 [debug] uPyEasy: Init: Create directory config exception: OS Error(17,)
2015-01-01 00:00:00 [debug] uPyEasy: Init: Create directory plugins
2015-01-01 00:00:00 [debug] uPyEasy: Init: Create directory plugins exception: O SError(17,)
2015-01-01 00:00:00 [debug] uPyEasy: Init: Create directory protocols
2015-01-01 00:00:00 [debug] uPyEasy: Init: Create directory protocols exception: OSError(17,)
2015-01-01 00:00:00 [debug] uPyEasy: Init: Create directory scripts
2015-01-01 00:00:00 [debug] uPyEasy: Init: Create directory scripts exception: O SError(17,)
2015-01-01 00:00:00 [debug] uPyEasy: Init: Create directory rules
2015-01-01 00:00:00 [debug] uPyEasy: Init: Create directory rules exception: OSE rror(17,)
2015-01-01 00:00:00 [debug] uPyEasy: Init: config Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: network Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: protocol Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: controller Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: hardware Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: dxpin Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: dxmap Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: plugin Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: pluginstore Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: device Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: service Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: notification Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: advanced Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: script Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: rule Table
2015-01-01 00:00:00 [debug] uPyEasy: Hal: Init
2015-01-01 00:00:00 [debug] uPyEasy: Hal: init, network record present
2015-01-01 00:00:00 [debug] uPyEasy: Hal: pyboard
2015-01-01 00:00:00 [debug] uPyEasy: Hal: board info
2015-01-01 00:00:00 [debug] uPyEasy: Hal: board pyboard
2015-01-01 00:00:00 [debug] uPyEasy: Hal: pyboard, spi is empty: trying default!


after this it locksup
Is there a solution???

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

Re: STM32 boards

#17 Post by LisaM » 15 Feb 2018, 21:36

frank wrote: 15 Feb 2018, 20:55 2015-01-01 00:00:00 [debug] uPyEasy: Hal: pyboard, spi is empty: trying default!


after this it locksup
Is there a solution???
Hi Frank,

Did you wire it according to these instructions? viewtopic.php?f=22&t=3905
Did you do a >>> upyeasy.setnet(1,'A4','A3')?

Cheers,

Lisa

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

Re: STM32 boards

#18 Post by LisaM » 15 Feb 2018, 21:54

micropet wrote: 06 Feb 2018, 09:15 So, next try.
With these commands I get into the network. The W5500 can also be pinged.

>>> import network
>>> nic = network.WIZNET5K(pyb.SPI(1), pyb.Pin.board.A4, pyb.Pin.board.A3)
>>> print(nic.ifconfig())
('192.168.0.210', '255.255.255.0', '192.168.0.3', '8.8.8.8')
>>> nic.isconnected()
True

2000-01-01 00:00:00 [debug] uPyEasy: Hal: board pyboard
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "upyeasy/__init__.py", line 40, in main
File "upyeasy/init.py", line 201, in init
File "upyeasy/hal.py", line 91, in init_network
AttributeError: 'WIZNET5K' object has no attribute 'active'


Do you have any idea?
According to the doc's on url: https://docs.micropython.org/en/latest/ ... twork.html the network call is:

Code: Select all

class network.WIZNET5K(spi, pin_cs, pin_rst)
So W5500 pin nSS connected to PA4 and nRESET connected to PA3.

The error is a bug, corrected and uploaded new version to releases.

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: STM32 boards

#19 Post by frank » 15 Feb 2018, 21:55

LisaM wrote: 15 Feb 2018, 21:36
frank wrote: 15 Feb 2018, 20:55 2015-01-01 00:00:00 [debug] uPyEasy: Hal: pyboard, spi is empty: trying default!


after this it locksup
Is there a solution???
Hi Frank,

Did you wire it according to these instructions? viewtopic.php?f=22&t=3905
Did you do a >>> upyeasy.setnet(1,'A4','A3')?

Cheers,

Lisa
MOSI connected to PA7
MISO connected to PA6
SCLK connected to PA5
nSS connected to PA4 Here i did SCS
nRESET connected to PA3

after >>> upyeasy.setnet(1,'A4','A3')?
I get this:
>>> upyeasy.setnet(1,'A4','A3')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'upyeasy' is not defined
>>>

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

Re: STM32 boards

#20 Post by LisaM » 15 Feb 2018, 22:13

frank wrote: 15 Feb 2018, 21:55 after >>> upyeasy.setnet(1,'A4','A3')?
I get this:
>>> upyeasy.setnet(1,'A4','A3')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'upyeasy' is not defined
>>>
Hi Frank,

>>> import upyeasy
>>> upyeasy.setnet(1,'A4','A3')

Cheers,

Lisa

frank
Normal user
Posts: 116
Joined: 15 Oct 2016, 20:17
Location: Nederland

Re: STM32 boards

#21 Post by frank » 15 Feb 2018, 22:16

>>> import upyeasy
>>> upyeasy.setnet(1,'A4','A3')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "upyeasy/__init__.py", line 23, in setnet
File "upyeasy/utils.py", line 30, in setnet
File "filedb.py", line 70, in update
AttributeError: type object 'networkTable' has no attribute '__fields__'
>>>

this is what i get

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

Re: STM32 boards

#22 Post by LisaM » 15 Feb 2018, 22:52

frank wrote: 15 Feb 2018, 22:16 >>> import upyeasy
>>> upyeasy.setnet(1,'A4','A3')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "upyeasy/__init__.py", line 23, in setnet
File "upyeasy/utils.py", line 30, in setnet
File "filedb.py", line 70, in update
AttributeError: type object 'networkTable' has no attribute '__fields__'
>>>

this is what i get
Hi Frank,

Does this also happen when you do:

Code: Select all

upyeasy.setnet(1,'A4','A3','192.168.0.210', '255.255.255.0', '192.168.0.3', '8.8.8.8')
?

Cheers,

Lisa

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

Re: STM32 boards

#23 Post by AndrewJ » 06 Mar 2018, 21:14

LisaM wrote: 15 Feb 2018, 22:52
frank wrote: 15 Feb 2018, 22:16 >>> import upyeasy
>>> upyeasy.setnet(1,'A4','A3')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "upyeasy/__init__.py", line 23, in setnet
File "upyeasy/utils.py", line 30, in setnet
File "filedb.py", line 70, in update
AttributeError: type object 'networkTable' has no attribute '__fields__'
>>>

this is what i get
Hi Frank,

Does this also happen when you do:

Code: Select all

upyeasy.setnet(1,'A4','A3','192.168.0.210', '255.255.255.0', '192.168.0.3', '8.8.8.8')
?

Cheers,

Lisa
Hi Lisa,
I'm having the same error as Frank...
And in answer to your question to him, if I do

Code: Select all

>>> upyeasy.setnet(1,'A4','A3','192.168.1.77', '192.168.1.1', '255.255.255.0', '192.168.1.1')
I get

Code: Select all

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "upyeasy/__init__.py", line 23, in setnet
  File "upyeasy/utils.py", line 30, in setnet
  File "filedb.py", line 70, in update
AttributeError: type object 'networkTable' has no attribute '__fields__'
I am using the Beta release .dfu file from Github.

When I do

Code: Select all

import upyeasy
upyeasy.main()
it looks as if upyeasy starts. I get some OSError17's on the way. It gets to the stage where it says it is running on 192.168.1.77:9000/, and starts the async processes, but however hard I try, I cannot access it from my browser ("192.168.1.77:9000 is unreachable"). I have set port 9000 in config/config. (I'm just wondering, does this affect ethernet, or only wifi??).
Hope this helps!
Andrew

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

Re: STM32 boards

#24 Post by karl222 » 15 Mar 2018, 16:02

LisaM wrote: 23 Dec 2017, 15:17 Firmware status: Beta
Firmware version: v0.2.0

For the PyBv3 with STM32F405 board:

BOM (Bill Of Materials): Wiring between Pyboard and W5500:
MOSI connected to PA7
MISO connected to PA6
SCLK connected to PA5
nSS connected to PA4
nRESET connected to PA3
Firmware upload instructions

Download the dfu-util tool here: http://dfu-util.sourceforge.net/

The uPyEasy FLASHBINARY file has this format: upyeasy_vXX_YYYYMMDD_test_esp32_2048.bin and is attached to this post as zip file.
The (latest) uPyEasy binary files can be downloaded here: https://github.com/letscontrolit/upyeasy/releases

Run this in REPL:
import pyb
pyb.bootloader()
Then you're kicked out of REPL due to boot mode.

Run this:
LINUX: sudo dfu-util --alt 0 -D upyeasy-pybv3.dfu
WINDOWS: dfu-util --alt 0 -D upyeasy-pybv3.dfu
After flashing the firmware, the dfu-util tool will reboot your pyboard.
After reboot, uPyEasy will auto-start.

If you have connected a W5500 as described above, no other steps are needed because uPyEasy is using DHCP to get the ip-address.
uPyEasy should be running on default port 80, so connect using your browser using: http://<your upyeasy ip address>:80

In linux you can use the following command to connect to the STM32: screen /dev/ttyACMx 115200,cs8
In Windows just use putty to connect to the com port COMx at 115200 baud speed.
If you have wired the W5500 otherwise, you'll get this message (or get stuck at Network init, then press ctrl-c):

Code: Select all

Exiting: Network not available, set network values!
Now, you'll need to set the correct parameters in REPL:

Code: Select all

upyeasy.setnet(<spi number>,'<machine pin nss>','<machine pin rst>')
And in the case of above wiring, it would be upyeasy.setnet(1,'A3','A4')
Then reboot using:

Code: Select all

import machine
machine.reset()
The uPyEasy webserver response is about 10x faster then the ESP32 WiFi response, due to the wired (1GB) network.
hi,

I was trying to wire up accordingly but couldn't find the nSS pin on the W5500. can someone help me on that...

thx
karl

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

Re: STM32 boards

#25 Post by AndrewJ » 15 Mar 2018, 19:14

hi,

I was trying to wire up accordingly but couldn't find the nSS pin on the W5500. can someone help me on that...

thx
karl
Hi karl,
I had the same issue. In the end, I used the one marked "SCS" on my W5500. It was a process of elimination for me, the others were pretty clear, so that seemed the nearest.
I'm still not sure if that was right, as I have been unable to access uPyEasy over my network, even though the log shows that uPyEasy has made a connection. But it may work for you, I hope so.
Good luck, let us know how it goes! ;)
Andrew

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

Re: STM32 boards

#26 Post by LisaM » 16 Mar 2018, 19:51

karl222 wrote: 15 Mar 2018, 16:02 hi,

I was trying to wire up accordingly but couldn't find the nSS pin on the W5500. can someone help me on that...

thx
karl
Picture of the W5500?

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

Re: STM32 boards

#27 Post by LisaM » 16 Mar 2018, 19:51

AndrewJ wrote: 15 Mar 2018, 19:14
hi,

I was trying to wire up accordingly but couldn't find the nSS pin on the W5500. can someone help me on that...

thx
karl
Hi karl,
I had the same issue. In the end, I used the one marked "SCS" on my W5500. It was a process of elimination for me, the others were pretty clear, so that seemed the nearest.
I'm still not sure if that was right, as I have been unable to access uPyEasy over my network, even though the log shows that uPyEasy has made a connection. But it may work for you, I hope so.
Good luck, let us know how it goes! ;)
Andrew
Can you post your W5500 also?

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

Re: STM32 boards

#28 Post by karl222 » 16 Mar 2018, 20:00


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

Re: STM32 boards

#29 Post by AndrewJ » 16 Mar 2018, 20:27

Mine is the same part.

Some additional info..,
I tried the same W5500 with a STM32F103 "Blue Pill" board using one of the example sketches (web server) and it worked fine. Connected to network, no problem connecting from my browser, and it supplied data to my browser, able to ping. In this scenario, I used the same SCS pin.

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

Re: STM32 boards

#30 Post by LisaM » 18 Mar 2018, 16:04

AndrewJ wrote: 16 Mar 2018, 20:27 Mine is the same part.

Some additional info..,
I tried the same W5500 with a STM32F103 "Blue Pill" board using one of the example sketches (web server) and it worked fine. Connected to network, no problem connecting from my browser, and it supplied data to my browser, able to ping. In this scenario, I used the same SCS pin.
For the STM32F103 to work, you'll need the STM32F103RG/STM32F103VG/STM32F103ZG because these have 1MB on board.

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

Re: STM32 boards

#31 Post by LisaM » 18 Mar 2018, 16:34

Attached pictures of my config, please adjust your config.
Run

Code: Select all

upyeasy.setnet(1,'A3','A4','192.168.178.135', '192.168.178.1', '255.255.255.0', '192.168.178.1')
(replace ip-addresses by your own ip, gateway, mask, dns)

Cheers,

Lisa
Attachments
IMG_4096.JPG
IMG_4096.JPG (1.94 MiB) Viewed 90169 times
IMG_4098.JPG
IMG_4098.JPG (2.32 MiB) Viewed 90169 times
IMG_4102.JPG
IMG_4102.JPG (3.26 MiB) Viewed 90169 times

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

Re: STM32 boards

#32 Post by AndrewJ » 18 Mar 2018, 16:37

LisaM wrote: 18 Mar 2018, 16:04
AndrewJ wrote: 16 Mar 2018, 20:27 Mine is the same part.

Some additional info..,
I tried the same W5500 with a STM32F103 "Blue Pill" board using one of the example sketches (web server) and it worked fine. Connected to network, no problem connecting from my browser, and it supplied data to my browser, able to ping. In this scenario, I used the same SCS pin.
For the STM32F103 to work, you'll need the STM32F103RG/STM32F103VG/STM32F103ZG because these have 1MB on board.
HI Lisa, Thanks for that info. My Blue Pill is a STM32F103C8T6 (with 128k flash), so not one of the models you mentioned. I bought it as a first step with STM32's (not uPyEasy).

BTW, I wasn't trying to get uPyEasy to work on the Blue Pill board (perhaps my post may have seemed that way). I wanted to test that the W5500 itself was capable of working by using it on another board (although it's different code). And in that setup it is ok, and my browser and network can connect to it.
So the issue seems to be my Pyboard clones (x2) and/or something in uPyEasy. The clones are the same as the ones you linked to at AliExpress in the first post of the STM32 thread, except I ordered through the AliExpress English site not the Dutch one.

When I get a bit more time, I'll try again with one of the Pyboard clones and uPyEasy, and connect a logic analyser to try to see what data is being transferred to/from the W5500.

Andrew

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

Re: STM32 boards

#33 Post by karl222 » 18 Mar 2018, 22:52

Hi,

I am not born for this...

1. I installed WinUSB via Zadig which works now.
2. I downloaded dfu-util. I have to use the win32 Version. When I doubleclick on dfu-util.exe a black cmd-window appears and disappeary shortly after and that's it.

or is it intended to use REPL commands first. This is not clear to me when I read the "manual'

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

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

What's the Problem? Any ideas?

Many thanks
Karl

p.s. LisaM: it is really a pitty with these dumb-users, I know. I hope we get with upyeasy to a point where evry idiot can handle it - even me :) . this is what espeasy makes so successfull

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

Re: STM32 boards

#34 Post by AndrewJ » 19 Mar 2018, 23:18

LisaM wrote: 18 Mar 2018, 16:34 Attached pictures of my config, please adjust your config.
Run

Code: Select all

upyeasy.setnet(1,'A3','A4','192.168.178.135', '192.168.178.1', '255.255.255.0', '192.168.178.1')
(replace ip-addresses by your own ip, gateway, mask, dns)

Cheers,

Lisa
Hi Lisa,
Thanks for the information. I've set my system up to match yours (I think!), After running the command you gave, it starts up and gets to the end of messages where it says it has connected to an IP address and is running the Async processes, but it is still not letting me connect from my browser. (unreachable) and I can't ping it successfully.

It's actually a bit hard to be sure from the photos which wire goes where. Some are almost hidden. Could you possibly list the connections between the STM32 and W5500?

Thanks in advance
Andrew

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

Re: STM32 boards

#35 Post by karl222 » 20 Mar 2018, 19:30

Andrew, don't give up, we'll get there :lol: :lol: :lol: :lol: :lol:

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

Re: STM32 boards

#36 Post by AndrewJ » 20 Mar 2018, 19:57

Hi Karl,
Yes, you're right, we will get there! What is good is that several of us are trying it, so we can all help each other.
Have you been able to try again since Lisa's photos? Were you able to tell which wires went where? Any luck?
I hope you have success!! :)
Andrew

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

Re: STM32 boards

#37 Post by karl222 » 20 Mar 2018, 20:12

No, wasn’t successful either. I don’t have mr gadgets goggles to see through wires :shock:

I did my next (unsuccessful) attempt with esp32 wrover, which I received today...

Maybe you can have a look on my thread in esp32 section...

Don’t give up, don’t give up, don’t give up, ... :geek:

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

Re: STM32 boards

#38 Post by AndrewJ » 25 Mar 2018, 13:29

LisaM wrote: 18 Mar 2018, 16:34 Attached pictures of my config, please adjust your config.
Run

Code: Select all

upyeasy.setnet(1,'A3','A4','192.168.178.135', '192.168.178.1', '255.255.255.0', '192.168.178.1')
(replace ip-addresses by your own ip, gateway, mask, dns)

Cheers,

Lisa
Hi @LisaM,
Thanks for posting these pictures. I've followed them as far as I can see, but my 2 STM32 boards with W5500 are still not allowing me to connect.
The log says it's connected but I can't see it in my router, ping it, or connect from web browser.
I'm using the dfu file from the Github releases page.
Yet when I tested my W5500 with a Blue Pill board and an Arduino-IDE sketch (webserver) it worked fine. So the problem seems to lie with the Pyboard clone, or the firmware, or the connections.

Could you please help me? I want to double-check that I'm connecting it right, as some of the wires are a bit hidden at the ends. My interpretation of your pictures is this - please could you confirm or make any corrrections?

Code: Select all

Pyboard clone		W5500			wire colour
PA3			SCS			light blue/green
PA4			RST			white
PA5			SCLK			purple
PA6			MISO			orange
PA7			MOSI			yellow
3v3			3v3			red
Gnd			GND			black
2nd question - I saw in the ESP32 boards thread that you'd found and corrected a bug in utils.py line 46. Might this also affect STM32, should I change it in my source code for the Pyboard clones?

I'm really keen to get something (anything! ;) ) working so I can test my OpenHAB MQTT on a real board! :geek:
Cheers,
Andrew

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

Re: STM32 boards

#39 Post by LisaM » 27 Mar 2018, 19:47

@andrewj: The colors are good, the wiring is good...
@karl222: Since the ESP32 is now, i'm currently looking at the STM32

STM32's are great, because the interrupts are hardware bound while the ESP32's have a software bound interrupt. Meaning that the STM32 latency is WAY lower then that of the ESP's, that also makes the ethernet way faster then wifi.

Pffffff, after update i ran into bugs. Filed them @micropython for help... :cry:

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

Re: STM32 boards

#40 Post by AndrewJ » 27 Mar 2018, 20:36

LisaM wrote: 27 Mar 2018, 19:47 @andrewj: The colors are good, the wiring is good...
@karl222: Since the ESP32 is now, i'm currently looking at the STM32

STM32's are great, because the interrupts are hardware bound while the ESP32's have a software bound interrupt. Meaning that the STM32 latency is WAY lower then that of the ESP's, that also makes the ethernet way faster then wifi.

Pffffff, after update i ran into bugs. Filed them @micropython for help... :cry:
Thanks for the update, Lisa.
Good luck with the bugs!! (life is never simple, is it?) ;)

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

Re: STM32 boards

#41 Post by LisaM » 28 Mar 2018, 00:02


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

Re: STM32 boards

#42 Post by AndrewJ » 04 Apr 2018, 22:40

LisaM wrote: 27 Mar 2018, 19:47 @andrewj: The colors are good, the wiring is good...
@karl222: Since the ESP32 is now, i'm currently looking at the STM32

STM32's are great, because the interrupts are hardware bound while the ESP32's have a software bound interrupt. Meaning that the STM32 latency is WAY lower then that of the ESP's, that also makes the ethernet way faster then wifi.

Pffffff, after update i ran into bugs. Filed them @micropython for help... :cry:
Hi Lisa,
Any news about the bugs on STM32?
Also, I think I notice some small changes in the source code in recent version which may affect the CS pin etc. Would these changes allow the latest code to be built and to run on STM32, do you think? Is it worth me giving it a try?
Regards
Andrew

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

Re: STM32 boards

#43 Post by LisaM » 05 Apr 2018, 01:08

AndrewJ wrote: 04 Apr 2018, 22:40
LisaM wrote: 27 Mar 2018, 19:47 @andrewj: The colors are good, the wiring is good...
@karl222: Since the ESP32 is now, i'm currently looking at the STM32

STM32's are great, because the interrupts are hardware bound while the ESP32's have a software bound interrupt. Meaning that the STM32 latency is WAY lower then that of the ESP's, that also makes the ethernet way faster then wifi.

Pffffff, after update i ran into bugs. Filed them @micropython for help... :cry:
Hi Lisa,
Any news about the bugs on STM32?
Also, I think I notice some small changes in the source code in recent version which may affect the CS pin etc. Would these changes allow the latest code to be built and to run on STM32, do you think? Is it worth me giving it a try?
Regards
Andrew
No update, this weekend i'll give it a try to work-around the bug so that we can build the STM32 version again...

Cheers,

Lisa

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

Re: STM32 boards

#44 Post by AndrewJ » 05 Apr 2018, 08:16

OK, thanks for the update. Good luck!
I'm ready to help with testing or any other way I can.
Andrew

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

Re: STM32 boards

#45 Post by AndrewJ » 13 Apr 2018, 13:19

LisaM wrote: 05 Apr 2018, 01:08
AndrewJ wrote: 04 Apr 2018, 22:40
LisaM wrote: 27 Mar 2018, 19:47 @andrewj: The colors are good, the wiring is good...
@karl222: Since the ESP32 is now, i'm currently looking at the STM32

STM32's are great, because the interrupts are hardware bound while the ESP32's have a software bound interrupt. Meaning that the STM32 latency is WAY lower then that of the ESP's, that also makes the ethernet way faster then wifi.

Pffffff, after update i ran into bugs. Filed them @micropython for help... :cry:
Hi Lisa,
Any news about the bugs on STM32?
Also, I think I notice some small changes in the source code in recent version which may affect the CS pin etc. Would these changes allow the latest code to be built and to run on STM32, do you think? Is it worth me giving it a try?
Regards
Andrew
No update, this weekend i'll give it a try to work-around the bug so that we can build the STM32 version again...

Cheers,

Lisa
Hi Lisa,
I noticed your post on MicroPython forum about a workaround for the bug...
https://forum.micropython.org/viewtopic ... 929#p26929

Does this mean that uPyEasy can be used now on STM32 simply by applying those patch commands (and I guess rebuilding Micropython?), or does something more need to happen first?

Cheers
Andrew

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

Re: STM32 boards

#46 Post by LisaM » 13 Apr 2018, 18:14

I've tried to fix the bugs, but they have change so much on the stm32 port that i lost track.
So, the work-around now is to roll back before they started to change the stm32 port on 31/1:

Code: Select all

git clone https://github.com/micropython/micropython.git micropython-stm32
cd micropython-stm32/
git submodule update --init
git checkout a275cb0f487cd6517760271dc01d369c32600c63
git pull origin pull/3379/head
This builds the firmware.dfu again, without the errors.

However... i now run into the problem:

Code: Select all

>>> import upyeasy
>>> upyeasy.main()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'main'
Pfffff. :evil:

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

Re: STM32 boards

#47 Post by AndrewJ » 13 Apr 2018, 20:26

LisaM wrote: 13 Apr 2018, 18:14 I've tried to fix the bugs, but they have change so much on the stm32 port that i lost track.
So, the work-around now is to roll back before they started to change the stm32 port on 31/1:

Code: Select all

git clone https://github.com/micropython/micropython.git micropython-stm32
cd micropython-stm32/
git submodule update --init
git checkout a275cb0f487cd6517760271dc01d369c32600c63
git pull origin pull/3379/head
This builds the firmware.dfu again, without the errors.

However... i now run into the problem:

Code: Select all

>>> import upyeasy
>>> upyeasy.main()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'main'
Pfffff. :evil:
Hmm, that's frustrating!
In the meantime I've been having a go. Here's what I did.
I used the commands you gave above, and it built without errors as you found.
Next, I re-built everything using the "new" micopython-stm32,
- I copied the upyeasy src contents into micropython-stm32/ports/stm32/modules/upyeasy
- copied modules contents into ....stm32/modules (had one or two duplicates where I chose the 'upyeasy' version)
- from repo root, did make -C mpy-cross
- in ...ports/stm32 I did
- make MICROPY_PY_WIZNET5K=5500 BOARD=PYBV3 (as I'm using the AliExpress clone board)
- then I connected 3v3 to BOOT0 and did
- sudo make MICROPY_PY_WIZNET5K=5500 BOARD=PYBV3 USE_PYDFU=0 deploy
(all of the above from your excellent document "uPyEasy Building Environment" with a few variations).

Reset and reconnected to USB and was able to connect to REPL
import upyeasy
upyeasy.main()
This worked ok for me, I didn't get the error you have, but it did stop with an error further on, which I'm sure is because I wanted to try it and hadn't connected the W5500 ;)

Good luck!
Andrew

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

Re: STM32 boards

#48 Post by LisaM » 14 Apr 2018, 00:11

The problem was that script.py imports re.py which is actually an unix library, script.py should import ure library which is a default micropython library. I fixed this, so it's working again. Apparently is main.py not findable if one the imports fails...

Cheers,

Lisa

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

Re: STM32 boards

#49 Post by AndrewJ » 14 Apr 2018, 08:39

LisaM wrote: 14 Apr 2018, 00:11 The problem was that script.py imports re.py which is actually an unix library, script.py should import ure library which is a default micropython library. I fixed this, so it's working again. Apparently is main.py not findable if one the imports fails...

Cheers,

Lisa
Ah, glad you've found that! :)
Which version of uPyEasy are you using? I realised belatedly that I was still using a previous version, not the latest with OpenHABmqtt. And did you find you needed to go through the whole building process like I was doing?

EDIT: forgot to ask, is W5500 now working for you?
Cheers
Andrew

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

Re: STM32 boards

#50 Post by LisaM » 14 Apr 2018, 12:24

AndrewJ wrote: 14 Apr 2018, 08:39
LisaM wrote: 14 Apr 2018, 00:11 The problem was that script.py imports re.py which is actually an unix library, script.py should import ure library which is a default micropython library. I fixed this, so it's working again. Apparently is main.py not findable if one the imports fails...

Cheers,

Lisa
Ah, glad you've found that! :)
Which version of uPyEasy are you using? I realised belatedly that I was still using a previous version, not the latest with OpenHABmqtt. And did you find you needed to go through the whole building process like I was doing?

EDIT: forgot to ask, is W5500 now working for you?
Cheers
Andrew
uPyEasy does compile but doesn't work, it doesn't repond to web requests. I'm trying to figure out why, i suspect that the asyncio changes in uPyEasy have something to do with it.

However this code works, so the W5500 is also working:

Code: Select all

import picoweb, uasyncio as asyncio

CONTENT = """\
<html>
  <head>
  </head>
  <body>
    <p>Hello #%d from uPyEasy!</p>
  </body>
</html>
"""

app = picoweb.WebApp(__name__)

@app.route("/")
def index(req, resp):
    yield from picoweb.start_response(resp)
    yield from resp.awrite(CONTENT)

class plugins(object):
    def __init__(self) :
        print("init")
        
    async def asyncdevices(self):
        print("async")

import network,pyb
nic = network.WIZNET5K(pyb.SPI(1), pyb.Pin.board.A3, pyb.Pin.board.A4)
while not nic.isconnected():
    pass
nic.active(1)
nic.ifconfig(('192.168.178.100', '255.255.255.0', '192.168.178.1', '192.168.178.1'))

loop = asyncio.get_event_loop()
_plugins = plugins()
loop.create_task(_plugins.asyncdevices())
app.run(host="0.0.0.0", port=80,debug=False)
Just put this content in a file in the STM32 flash root, reboot and then import the file. You then can connect to the STM32.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests