Shop OBEX P1 Docs P2 Docs Learn Events
Tried following directions to get MicroPython running on a new P2 Edge/development board! — Parallax Forums

Tried following directions to get MicroPython running on a new P2 Edge/development board!

I am running Ubuntu 22 as a development platform and would like to know if there are 'tested' instructions that will get me up and running MicroPython on the P2?
While I am pretty proficient technically, this is my first dive into this exciting combination!

Comments

  • roglohrogloh Posts: 5,284
    edited 2023-07-13 13:12

    The general help for this is here:

    https://www.parallax.com/propeller-2/get-started/micropython/

    There was a recent discussion covering how to get MP up and running here:

    https://forums.parallax.com/discussion/175372/unable-to-get-micropython-to-respond-to-terminal-input#latest

    There were issues encountered in flashing MP due to image sizes which were eventually resolved near the end of the thread. Also there is another post with another way to solve it...

    https://forums.parallax.com/discussion/175413/upython-w-o-sd-card#latest

    But I don't think there are any "tested" instructions for Ubuntu 22 specifically.

    Basically you'll need to get loadp2 installed and operating to be able to load the MP image into the P2 Edge. You'll also of course need a console or terminal program such as minicom to talk to the serial port connected to the P2 Edge, or possibly use loadp2 itself with the "-t" option after loading to RAM, depending on how you plan to run it, via boot flash or download first to RAM etc.

    If instead you are talking about building you own native MP images that is another story. I build it on an old Mac 0S X 10.10.5 machine and provide the image to Tubular and ozpropdev who then tweak with other features they put in. For the actual image build I do I had to cobble together a bunch of tools and files including propeller-gcc, p2gcc, Micropython 1.13 sources with my changes for the P2, and any other tool dependencies I found needed in the MP build process. It was quite an effort at the time. The MP sources have been captured in a github tree here (in the p2native branch) and some suggested build instructions but not much else. It'll be an effort to get it to work for sure, but it might be possible.

    https://github.com/team-oz/p2-native-micropython/tree/p2native/ports/p2

    If you are able to get it working on Ubuntu 22, it would be good if you could track what you do and it can be documented for others.

  • FlexPropGUI appears to be required for Linux, yet:
    I go here: https://www.parallax.com/propeller-2/get-started/micropython/
    And encounter:
    "Follow instructions for installing FlexPropGui, here"
    --- there is no link.

    I took it over to a Windoze machine and followed the instructions for that OS. Now I get the Python prompt when I come back to the Linux box and use Minicom!

    It doesn't seem like Minicom will be much of a development environment. ;)
    Am I to understand that FlexPropGUI is a preferred development environment? I also see something called "Mu Alpha" ... any suggestions? It's almost time to embark on getting educated in Python!

    Thank you for the help/input!

    Regards,
    Michael

  • roglohrogloh Posts: 5,284
    edited 2023-07-13 23:40

    Glad you got it working Michael.
    You can use whatever console/terminal you wish to talk to the P2, and minicom is old and was not designed specifically for python. I just knew it was available on Linux which is why I mentioned it. Mu (which I've not used) apparently is another one that is more modern and aimed at python and so is probably better for supporting that. I think a "preferred" IDE will always be a personal choice so it may be good to just try out a few and see which one works best for you.
    Cheers.

  • Gave Minicom a try ... I can hit the reset button on the EDGE dev board and get the "Native P2 MicroPython ..." prompt, however, I get no response to my keystrokes from the board. My username is part of the dialout group, so I'm stumped!

  • Assuming TX characters are getting to the board (eg a Led flashes) - this sounds a little bit like the trouble Pedward was having, where he was getting the MP prompt but then it wouldn't respond.

    If its the same thing, this post and the one after it might be worth a try
    https://forums.parallax.com/discussion/comment/1551532/#Comment_1551532

    Don't worry too much about Mu until you have a basic terminal working and MP echoing and responding. Mu and others (thonny etc) sit on top of the serial interface once thats running

  • There are no LED flashes as I hit 'Enter' on the keyboard during a minicom session. I do notice that minicom will only work as root. Might there be a permissions problem that would allow the 'prompt' screen to appear, but not be able to receive characters?

  • No blinky lights on the FTDI board either ...

  • The output of dmesg will display:
    FTDI USB Serial Device converter now attached to ttyUSB0

    Yet, when I open minicom to that port, the display shows the results of the reset button on the dev board, but doesn't respond to keyboard input. I also would expect to see some activity on the FTDI board LED's, but nothing there either.

  • Yet, when I walk to P@ setup over to a Windoze box, and use Putty ... it works just fine! So it's something that's not getting setup in Linux.

  • roglohrogloh Posts: 5,284
    edited 2023-07-14 04:57

    To prove/rule out whether you have underlying Linux serial issues, you can carefully wire the TX pin to the RX pin at your USB serial port / "PropPlug" and see if you can echo characters back in minicom. Maybe your username is not a member of the dialout group or something permissions oriented. Been ages since I configured an FTDI serial interface on Linux but there's often permissions issues with setting up HW and I've hit these sorts of things before as well.

    Update:
    if that doesn't help you may also need to add yourself to tty group too based on this information (albeit for Ubuntu 18.04)...
    https://arduino.stackexchange.com/questions/74714/arduino-dev-ttyusb0-permission-denied-even-when-user-added-to-group-dialout-o

Sign In or Register to comment.