I have put together the v1 XRP kit and connected it to XRPCode. After successfully updating the firmware to XRPLib v2.0.1, I am unable to run the installation_verification.py in the XRPExamples directory. I see the following error in the MicroPython console:
Traceback (most recent call last):
File "<stdin>", line 37, in <module>
File "XRPExamples/installation_verification.py", line 1, in <module>
File "/lib/XRPLib/defaults.py", line 18, in <module>
File "/lib/XRPLib/encoded_motor.py", line 36, in get_default_encoded_motor
File "/lib/XRPLib/motor.py", line 61, in __init__
ValueError: unknown named pin "MOTOR_L_IN_1"
Traceback (most recent call last):
File "<stdin>", line 50, in <module>
File "/lib/XRPLib/resetbot.py", line 43, in <module>
File "/lib/XRPLib/resetbot.py", line 11, in reset_motors
File "/lib/XRPLib/encoded_motor.py", line 36, in get_default_encoded_motor
File "/lib/XRPLib/motor.py", line 61, in __init__
ValueError: unknown named pin "MOTOR_L_IN_1"
This is the firmware / lib version displayed in the REPL:
MicroPython v1.25.0-preview.208.g1e83cd914 on 2025-01-14; SparkFun XRP Control Board V2 with RP2350
I’m not sure where those pin aliases are stored. Can I get around this by replacing the unknown pin name with the GPIO number instead, i.e. IO30 or IO31?
It looks like the expected pin names are different in MicroPython than the XRPLib. After updating all the defaults to the matching names on the Pin.board, the installation_verification.py runs successfully.
I can submit a PR to the open source codebase later to see if this is the correct fix for everyone using the v1 XRP.
There is a problem that we are investigating that the XRP needs to be reset once after the update as there is an old version of part of the XRPLib that is not getting cleared from memory. After the reset things should run fine.
I am new to XRP and micropython. I just assembled the SparkFun XRP kit. I got the same error when running “from XRPLib.defaults import *”…
ValueError: unknown named pin “MOTOR_L_IN_1”
How do I update Pin.board? Looks like something is corrupted in the lib.
Please advise. Thanks.
How do I reset XRP board V2 with RP2350? I tried power off and USB cable off. But I am still getting the same error with unknown named pin “MOTOR_L_IN_1”. Please advise.
I’ll try out the reset using the button on the board after the update. I’ve run into that issue after updating those XRPLib files not taking effect after saving until resetting the board.
Sorry to hear y’all were having this problem! It seems like some boards may have been shipped out with the wrong version firmware. Not sure how that happened, we’re going to investigate this to ensure it doesn’t happen again in future production runs.
This is the firmware / lib version displayed in the REPL:
MicroPython v1.25.0-preview.208.g1e83cd914 on 2025-01-14; SparkFun XRP Control Board V2 with RP2350
Thank you so much for posting this, very helpful! The boards from the first production run should report MicroPython v1.25.0-preview.beta06 on 2025-02-17; SparkFun XRP Controller with RP2350. @Fgrossman Maybe we can add a special check to XRPCode to force a firmware update if v1.25.0-preview.208.g1e83cd914 on 2025-01-14 is detected?
The reason for these error messages is because your boards have an outdated firmware version before we had finalized the pin names. The names used by XRPLib are correct, you just need to update your firmware to fix the pin names. See my other post here for how to do that:
We want to thank you for bringing this problem to us. We put out an updated fix to XRPCode last night and it will now update to the correct version of MicroPython that matches with the XPRLib libraries under these conditions.
Thank you for making the fix! I’ve confirmed loading up XRPCode updates MicroPython to the expected version MicroPython v1.25.0-preview.beta06 on 2025-02-17; SparkFun XRP Controller with RP2350