Hi All,
I have an SF6W and an SF2W. The SF2W has umqtt.simple available as an importable module, my SF6W does not. The firmware versions are:
SF2W: MicroPython v1.10-418-g8ef236ec5-dirty on 2019-03-26; PYBD_SF2W with STM32F722IEK
SF6W: MicroPython v1.10-284-g4417c03a9-dirty on 2019-04-05; PYBD_SF6W with STM32F767IIK
Can anyone help with this. I'm relatively new, so this might be a simple fix. like loading umqtt.simple from somewhere (although I cannot find any evidence of it in the SF2W file system).
Help! (and thanks)
Phil
simple.umqtt
Re: simple.umqtt
If your device is connected to the internet, you can install it via:
Otherwise you can download it from https://github.com/micropython/micropython-lib
Code: Select all
import upip
upip.install("umqtt.simple", "lib")
Re: simple.umqtt
Thanks Robert - very impressive response time!
I tried your suggestion using upip, but it gave an error relating to certificates:
>>> upip.install("umqtt.simple", "lib")
Installing to: lib/
Warning: pypi.org SSL certificate is not validated
Error installing 'umqtt.simple': Package not found, packages may be partially installed
Undaunted, I went along the alternative route and downloaded a text (raw) version of 'micropython-lib/umqtt.simple/umqtt/simple.py'. I had some trouble with the name - it would never work with the name umqtt.simple.py (kept saying no module named umqtt), so in the end I called it simple.py, stored it in flash/libs, and it works. I'll return to the naming issue, but for now I'm happy.
Thanks again,
Phil
I tried your suggestion using upip, but it gave an error relating to certificates:
>>> upip.install("umqtt.simple", "lib")
Installing to: lib/
Warning: pypi.org SSL certificate is not validated
Error installing 'umqtt.simple': Package not found, packages may be partially installed
Undaunted, I went along the alternative route and downloaded a text (raw) version of 'micropython-lib/umqtt.simple/umqtt/simple.py'. I had some trouble with the name - it would never work with the name umqtt.simple.py (kept saying no module named umqtt), so in the end I called it simple.py, stored it in flash/libs, and it works. I'll return to the naming issue, but for now I'm happy.
Thanks again,
Phil
Re: simple.umqtt
Hi again,
I returned to the naming issue - the '.' between umqtt and simple represents a file path umqtt/simple, so when I saved the file 'simple.py' into /libs/umqtt/ it all worked!
[but I guess most of you knew that already . . . ]
Anyway, great forum, full of helpful people
Phil
I returned to the naming issue - the '.' between umqtt and simple represents a file path umqtt/simple, so when I saved the file 'simple.py' into /libs/umqtt/ it all worked!
[but I guess most of you knew that already . . . ]
Anyway, great forum, full of helpful people
Phil
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: simple.umqtt
I suggest you read up on Python packages.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.