Micropython seems to be broken on Raspberry Pi pico and other hardware problems

Micropython is broken on Raspberry Pi pico and other hardware problems…

  1. micropython
  2. defective hardware
  3. Legacy modems don’t work with current version of notecarrier B

.

  1. Micropython:
    The micropython driver libraries downloaded from note-python/notecard at main · blues/note-python · GitHub do not work.
    They contain syntax errors, specifically they use the “import .filename” notation which does not work on RPi pico micropython.
    Correcting the import statements does NOT fix the problem it only yields other errors. Looking at the repository it has been a couple of years since the last commit. Is there a more current location for micropython drivers for the notecards ?

Luckily I checked the old drivers into source control…
Using the old version of the drivers does work with both the “legacy” notecards as well as the current hw verion (2.1) notecards.
Unfortunately the “req”: “card.time” returns :

{“mode”: “minimum”, “product”: “tech.my_domain_name.yossa:smartbuoy”, “req”: “card.time”}
{“err”:“time is not yet set {no-time}”,“zone”:“UTC,Etc/UTC”}

(It previously worked in earlier versions of the hardware-software)
but other than that the data is transmitted successfully to notehub using the old libs on both the legacy and the hw version 2.1 notecards.

  1. defective hardware
    One of the current style modems does not sync with notehub. It is essentially unused.
    (Tried switching out the antennas, and notecarriers…) The others do → conclusion it is busted.
    What is the a process for returning defective hardware ?

  2. Legacy modems don’t work with current version of notecarrier B
    The current version of the notecarrier B does not work with the legacy notecards.
    I have several old motherboards which use the old style notecarrier and the legacy modem works fine on them, When I move the legacy modem to the current style notecarrier B the modem no longer syncs with notehub. Returning it back to the old style notecarrier and it once again syncs. (same old version micropython drivers on both setups)
    Is that a known issue?

The situation:
A couple years ago I developed a mariculture monitoring buoy based on the following hardware:
RaspberryPi pico
Micropython firmware
custom software
custom PCB
blues.io LTE modem

The buoys worked well (until they eventually flooded or were lost) now trying to send up another batch to replace the ones that drown …
Any ideas / suggestions?

cheers
~Yossa

Hi Yossa,

Thanks for reaching out. I’m sorry to hear you’re running into these problems with note-python. I’m one of the main note-python devs; I have never tested the Pico + MicroPython combination. We will attempt to reproduce the errors you’re seeing on our end. I don’t have a Pico on hand, but one of my colleagues does, and they’re going to take a look next week.

{“mode”: “minimum”, “product”: “tech.my_domain_name.yossa:smartbuoy”, “req”: “card.time”}

I’m a bit confused on this request. card.time doesn’t accept mode or product arguments. Those typically go with a hub.set request.

One of the current style modems does not sync with notehub. It is essentially unused.
(Tried switching out the antennas, and notecarriers…) The others do → conclusion it is busted.
What is the a process for returning defective hardware ?

Just to check my understanding, you have multiple, identical Notecard 2.1’s, and only one of them is unable to sync with Notehub? Could you try sending the following requests to that Notecard (the blues.dev in-browser terminal may be helpful here) and send me the output for all the requests?

  • Factory reset: {"req": "card.restore", "delete": true}
  • Set ProductUID: {"req": "hub.set", "product", "<insert your ProductUID>"}
  • Force a sync: {"req": "hub.sync"}
  • Monitor sync status: {"req": "hub.sync.status"} Issue this one periodically to see sync progress. If the card can’t sync, you should see an error returned in the response to this request, eventually.

If we don’t get enough useful info from that experiment, there are some deeper debug logs we can extract, but let’s try these requests, first.

The current version of the notecarrier B does not work with the legacy notecards. I have several old motherboards which use the old style notecarrier and the legacy modem works fine on them, When I move the legacy modem to the current style notecarrier B the modem no longer syncs with notehub. Returning it back to the old style notecarrier and it once again syncs. (same old version micropython drivers on both setups) Is that a known issue?

There’s no known issue with legacy (green) Notecards and Notecarrier-B v3.1 that I am aware of. I just plugged a NOTE-WBNA into one of these carriers and was able to sync with Notehub, using the same series of requests I mentioned above. Could you try these requests using a micro USB cable connected to the Notecarrier-B and the blues.dev in-browser terminal? I think it’ll be helpful to remove the Pico running MicroPython from the picture, to better isolate the source of the problem.

Thanks for your patience!

Hayden
Blues staff firmware engineer

Hello Hayden,
Thank you for your prompt reply!

After nearly a week of pure frustration I think I have resolved the hardware problems to an issue with the micropython firmware, specifically instantiation of the baked in i2c object.

the unit test code for the blues.io modem originally looked like this:

--------------------------------- test code LTE_send.py ---------------------------------------------
from machine import Pin, I2C

import notecard

productUID = “tech.oceancdr.yossa:smartbuoy”

i2c = I2C(1)
print(i2c.scan())
card = notecard.OpenI2C(i2c, 23, 0, debug=True)
print(“Connected to Notecard…”)

req = {“req”: “hub.set”,
“product”:productUID,
“mode”:“minimum”,
“req”: “card.time”}

rsp = card.Transaction(req)

req = {“req”: “note.add”}
req[“file”] = “sensors.qo”
req[“body”] = { “data”:"test data #3 ! " }
req = card.Transaction(req)

req = {“req”: “hub.sync”}
req = card.Transaction(req)

---------------------------------- end test code ----------------------------------

The code works consistently on older versions of the hardware and inconsistently on new versions. I have tried it across several different RPi Pico MCU’s, two legacy modems, and (2) HW2.1 modems. The only place the modems worked every time was on a 2 yr old motherboard with old style notecarrier B and the green modem.

when I changed the line:

i2c = I2C(1)

to explicitly create the object on i2c channel 1:

i2c = I2C(1, scl=Pin(15), sda=Pin(14), freq=100000)

The modem started working correctly,

Retrying the github drivers with the code change they now also work.
→ Operator error

I apologize for the fire drill(!)

Cheers
~Yossa