Notifications
Clear all

Banana Pi  

  RSS
kohend
(@kohend)
Member
Banana Pi

Since the Raspberry Pi Zero W 2 is about as hard to come by as 50 karat diamonds, I ordered a Banana Pi and thought it would be hardware compatible.
Spoiler: it's not.
Once I got Linux on it, would it be possible to get PrusaLink on it somehow? I'm very knowledgeable about Linux, but I have no idea if the software is based on scripts, binary files, combination of the two?
If it is script based and I extract the relevant files, will it be a violation of the license?

Posted : 13/02/2022 7:48 pm
DanielAttia
(@danielattia)
Member
RE: Banana Pi

The PrusaLink image is running on top of Raspberry Pi OS, so I assume that it would be incompatible as is because it would require a lot of modifications to the code to work correctly.

Posted : 13/02/2022 9:29 pm
kohend
(@kohend)
Member
Topic starter answered:
RE: Banana Pi

The Armbian image is very similar to Raspberry Pi OS from what I know.

Posted : 15/02/2022 10:01 am
Tojik
(@tojik)
Member Moderator
RE: Banana Pi

It can work alright, just copy the source code from the image. That includes the SDK and Link, then use pip3 to install them both. You'll also need the script in/etc/rc.local to start it up on boot. I personally prefer using a systemd service, but I was denied doing it that way. You can do either one tho 😉

If your port is named differently, see https://forum.prusa3d.com/forum/postid/491524/ to help you configure it

 

Posted : 16/02/2022 11:49 am
Timo
 Timo
(@timo-2)
Member
RE:

 

Posted by: @tojik

It can work alright, just copy the source code from the image. That includes the SDK and Link, then use pip3 to install them both. You'll also need the script in/etc/rc.local to start it up on boot. I personally prefer using a systemd service, but I was denied doing it that way. You can do either one tho 😉

If your port is named differently, see https://forum.prusa3d.com/forum/postid/491524/ to help you configure it

 

@Tojik You are an absolute legend!

This screenshot is from Armbian 21.08 Bullseye running on an Orange Pi PC.

This is unfortunately connected to my Prusa Mini which is not supported yet. (Both my MK3s have a Raspberry Pi Zero 2 W that I did not want to mess with). But Prusa Link seems to be running fine.

So I can confirm that it is possible to run Prusa Link on different hardware.

  • Make sure your python3 is version 3.9.2
  • Make sure you have a user named pi with sudo rights
  • copy .local directory over from Prusa Image to /home/pi
  • copy Prusa-Connect-SDK-Printer directory over from Prusa Image to /home/pi
  • copy Prusa-Link directory over from Prusa Image to /home/pi
  • make sure the directories and files belong to user and group pi
    • else run
      
      chown -R pi:pi /home/pi/Prusa-Connect-SDK-Printer
      chown -R pi:pi /home/pi/Prusa-Link
      chown -R pi:pi /home/pi/.local
  • chmod +x the correct files in .local/bin/
    • chmod +x prusa-link
      chmod +x unidecode
      chmod +x rst*
  • change into Prusa-Connect-SDK-Printer and run pip3 install -U ./
  • change into Prusa-Link and run pip3 install -U ./
  • edit /etc/rc.local
    #!/bin/sh -e
    #
    # rc.local
    #
    # This script is executed at the end of each multiuser runlevel.
    # Make sure that the script will "exit 0" on success or any other
    # value on error.
    #
    # In order to enable or disable this script just change the execution
    # bits.
    #
    # By default this script does nothing.
    
    # Print the IP address
    _IP=$(hostname -I) || true
    if [ "$_IP" ]; then
      printf "My IP address is %s\n" "$_IP"
    fi
    
    iptables -t nat -A PREROUTING -i wlan0 -p tcp --dport 80 -j REDIRECT --to-port 8080
    iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
    
    printf 'M117 Starting Prusa Link\n' > /dev/ttyACM0
    rm -f /home/pi/prusa-link.pid
    export PYTHONOPTIMIZE=2
    su pi -c '/home/pi/.local/bin/prusa-link -i start'
    
    exit 0
  • create and edit /etc/Prusa-Link/prusa-link.ini for USB
    • [printer]
      port=/dev/ttyACM0
      baudrate=115200

I think you will also need 'Prusa Link gcodes' directory in /home/pi.

To anyone attempting this. Keep in mind: This is totally unsupported.

This post was modified 3 years ago by Timo

I have no special talent. I am only passionately curious

Posted : 16/02/2022 4:56 pm
Lukáš Řádek and liked
Timo
 Timo
(@timo-2)
Member
RE: Banana Pi

 

Posted by: @kohend

Since the Raspberry Pi Zero W 2 is about as hard to come by as 50 karat diamonds, I ordered a Banana Pi and thought it would be hardware compatible.
Spoiler: it's not.
Once I got Linux on it, would it be possible to get PrusaLink on it somehow? I'm very knowledgeable about Linux, but I have no idea if the software is based on scripts, binary files, combination of the two?
If it is script based and I extract the relevant files, will it be a violation of the license?

Seems like Banana Pi is also supported on https://www.armbian.com/download/?device_support=Supported

I have no special talent. I am only passionately curious

Posted : 16/02/2022 4:57 pm
DanielAttia
(@danielattia)
Member
RE: Banana Pi

Any plans on having the code public on GitHub in the near future? At least the PrusaLink code (is it currently private because of the Private Beta?)

Posted by: @tojik

It can work alright, just copy the source code from the image. That includes the SDK and Link, then use pip3 to install them both. You'll also need the script in/etc/rc.local to start it up on boot. I personally prefer using a systemd service, but I was denied doing it that way. You can do either one tho 😉

If your port is named differently, see https://forum.prusa3d.com/forum/postid/491524/ to help you configure it

 

 

Posted : 16/02/2022 5:03 pm
Tojik
(@tojik)
Member Moderator
RE: Banana Pi

This is so much more work, than I'd advocate for. You must have understood me wrong, or the pip way didn't work for you. You have effectively transplanted an install. All I thought you'd have to do was copy the folders named Prusa-Link and Prusa-Connect-SDK-Printer from the home directory over and run

pip3 install .

in SDK and then Link. Sorry I wasn't clear on that. Also yes, the gcodes folder is kinda important if you want those. 😀

Glad it "works" for you regardless

Posted : 16/02/2022 5:09 pm
DanielAttia
(@danielattia)
Member
RE: Banana Pi

I’m not personally installing PrusaLink on a Banana Pi. It’s just been a while since someone from the Prusa team has been active on the forum, so I was just curious to know the about the current status of having the code available on GitHub. 

Posted : 16/02/2022 5:12 pm
Tojik
(@tojik)
Member Moderator
RE: Banana Pi

Yup, the code is private to prevent people from looking at the code too much and seeing the junior level "stuff" I wrote 😀 We have licenses to decide upon and things to clean, fix, maybe even document. But the client side will be going public somewhere around/after release.

Posted : 16/02/2022 5:14 pm
Tojik
(@tojik)
Member Moderator
RE: Banana Pi

Also sorry, I had subscriptions set wrong, so I wasn't getting notified. I am not accustom to using forums

Posted : 16/02/2022 5:21 pm
Timo
 Timo
(@timo-2)
Member
RE: Banana Pi

 

Posted by: @tojik

This is so much more work, than I'd advocate for. You must have understood me wrong, or the pip way didn't work for you. You have effectively transplanted an install. All I thought you'd have to do was copy the folders named Prusa-Link and Prusa-Connect-SDK-Printer from the home directory over and run

pip3 install .

in SDK and then Link. Sorry I wasn't clear on that. Also yes, the gcodes folder is kinda important if you want those. 😀

Glad it "works" for you regardless

No worries.
I ran pip3 install -U in both directories instead of pip3 install .

Just as a proof of concept I connected my MK2.5s instead of the Mini. (As said earlier both my MK3s are already running Prusa Link).
It's not a supported printer at the moment but I did a small fix to fake the MK2.5s as an MK3s and it connects perfectly fine to Prusa Connect.

Because it is a not supported printer it won't function 100%. ( It doesn't report the temperatures). But it was good enough to test a homing command from Prusa Connect. That is working.

So to avoid misunderstanding:
The goal was to try and run Prusa Link on different hardware than a Raspberry Pi.

  • That seems to be working from what I can see.
  • This might help people that can not get a Raspberry Pi because of shortages. *And have the knowledge and are willing to go this route
  • I will not share how I faked the MK2.5s to MK3s because that might disrupt the beta testing process.
  • I will also not be printing with the MK2.5s. This is as far as I will go. (Only did it because I don't have an extra MK3s to test with)
  • From Prusa Connect I was able to test
    • Homing -> Works OK
    • Browse the content of the local SD Card in the MK2.5s -> Works OK

I have no special talent. I am only passionately curious

Posted : 16/02/2022 6:08 pm
Lukáš Řádek
(@lukas-radek)
Active Member
RE: Banana Pi

I assume you were connecting the OrangePi with Prusa using USB cable right?

I anybody aware of any potential technical obstacles that would prevent Banana Pi M2 ZERO to connect via the GPIO pins (just like RPi Zero is supposed to)?

Posted : 26/02/2023 5:27 pm
cwbullet
(@cwbullet)
Member
RE: Banana Pi

I have used both a Banana and Orange Pi. Both work, and both were slower than the Rasp Pi 4.  

--------------------
Chuck H
3D Printer Review Blog

Posted : 27/02/2023 3:36 am
Timo
 Timo
(@timo-2)
Member
RE: Banana Pi

Yes, using USB. It's fine because I have it connected to my MK2.5s.

As far as I can tell, to use the GPIO pins RPi.GPIO is used. Maybe using OPi.GPIO on Orange Pi would work, but I haven't looked into that.

I have no special talent. I am only passionately curious

Posted : 27/02/2023 7:56 am
Lukáš Řádek
(@lukas-radek)
Active Member
RE: Banana Pi

@cwbullet I guess the speed is in relation to the boards used. I am concidering replacing RPi Zero (2) with BananaPi M2 Zero which should be significantly more performant.

@Timo Well in that case hopefully they have the same API. Is the PrusaLink source code editable or is it binaries?

Posted : 27/02/2023 12:30 pm
cwbullet
(@cwbullet)
Member
RE: Banana Pi

It is.  I have all of the Banana and Orange Pi boards.  I bought them to test with Octoprint, and only one is faster than a Raspberry Pi 4.  The 5 is faster.  The 4 is close.  

Posted by: @lukas-radek

@cwbullet I guess the speed is in relation to the boards used. I am concidering replacing RPi Zero (2) with BananaPi M2 Zero which should be significantly more performant.

@Timo Well in that case hopefully they have the same API. Is the PrusaLink source code editable or is it binaries?

 

--------------------
Chuck H
3D Printer Review Blog

Posted : 27/02/2023 1:17 pm
Timo
 Timo
(@timo-2)
Member
RE: Banana Pi

Yes, Prusalink source code is available on the Prusa Github.

Quick search: https://github.com/prusa3d/Prusa-Link/search?q=GPIO
shows prusa/link/serial/serial_adapter.py is using wiringpi (from line 346).

So if you would find a wiringpi that is working for an orange or banana it should be doable.
https://github.com/orangepi-xunlong/wiringOP as a starting point maybe?

Then again. Just running it using USB is already working without issues. And has the benefit that the pi is not abruptly shutdown on printer power off. 

I have no special talent. I am only passionately curious

Posted : 27/02/2023 2:16 pm
Lukáš Řádek
(@lukas-radek)
Active Member
RE: Banana Pi

Thank you! I like the integrated feel of having the Pi in the box .😁

Posted : 27/02/2023 7:44 pm
Share: