simple.umqtt

The official PYBD running MicroPython, and its accessories.
Target audience: Users with a PYBD
Post Reply
ptranter
Posts: 8
Joined: Mon Dec 03, 2018 8:39 pm

simple.umqtt

Post by ptranter » Thu Jun 06, 2019 4:43 pm

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

Online
User avatar
Roberthh
Posts: 1461
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: simple.umqtt

Post by Roberthh » Thu Jun 06, 2019 6:45 pm

If your device is connected to the internet, you can install it via:

Code: Select all

import upip
upip.install("umqtt.simple", "lib")
Otherwise you can download it from https://github.com/micropython/micropython-lib

ptranter
Posts: 8
Joined: Mon Dec 03, 2018 8:39 pm

Re: simple.umqtt

Post by ptranter » Thu Jun 06, 2019 9:15 pm

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

ptranter
Posts: 8
Joined: Mon Dec 03, 2018 8:39 pm

Re: simple.umqtt

Post by ptranter » Thu Jun 06, 2019 9:27 pm

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

User avatar
pythoncoder
Posts: 3455
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: simple.umqtt

Post by pythoncoder » Fri Jun 07, 2019 7:50 am

I suggest you read up on Python packages.
Peter Hinch

Post Reply