Astroprint on Orange Pi Zero


#1

Hi Guys,

I have a Tevo Black Widow(with the Mega 2560 board), got my setup ready quite happy but i really want to print remotely, anyway i was planning on buying a raspberry pi and doing this the normal way, however I noticed that i have a Orange Pi Zero just doing nothing so here I go.

I cloned the astroprint repo, went on a bit of a stuff around installing all the requirements and finally managed to get the process to run and launch the Astroprint GUI(I will be documenting it all in a tutorial section for anybody else who wants to do it with an orange pi), it all seems to function however when i get to the connect the printer section, it doesn’t seem to recognize that i have a printer connected connected, now I can see it in “lsusb” so the debian distribution is definitely seeing it.

Would anybody know what issue i’m experiencing?

Obviously i could install Octoprint, but i’ve read much better things about Astroprint, any help will be greatly appreciated!


#2

Off hand that initial connection issue is often baud rate. Try 115200 on bothe the Pi and in Printer Firmware. Not sure why but that speed always seems the best for me while faster and slower rarely work.


#3

I got today 2 Orange pi to test Astroprint. There is raspbian image for it, so as mentioned by @Michael2 there shouldn’t be too many issues to get it working. I will keep this updated as soon as possible because it is a very cheap and capable board :smiley:


#4

As @Michael2, I wanted to get Astroprint working on Orange Pi I bought. After several days trying to get it working I solved most errors and missing dependencies. But im giving up.

At the last installation instructions posted on github you have to run:

sudo python ./run --config /etc/astrobox/config.yaml --host 127.0.0.1

And I get:

Traceback (most recent call last):
  File "./run", line 23, in <module>
    octoprint.main()
  File "/root/AstroBox/src/octoprint/__init__.py", line 77, in main
    startServer(args.config, args.basedir, args.host, args.port, args.debug, args.allowRoot, args.logConf)
  File "/root/AstroBox/src/octoprint/__init__.py", line 99, in startServer
    astrobox.run()
  File "/root/AstroBox/src/octoprint/server/__init__.py", line 406, in run
    softwareManager = swManager()
  File "/root/AstroBox/src/astroprint/software.py", line 12, in softwareManager
    _instance = SoftwareManager()
  File "/root/AstroBox/src/astroprint/software.py", line 289, in __init__
    open(self._infoFile, 'w').close()
IOError: [Errno 2] No such file or directory: '/etc/astrobox/software.yaml'

So I think there is a config file (/etc/astrobox/software.yaml) not included on Astrobox github which is only included on the Raspberry Pi image.

I wrongly opened an issue on github about another error I’ve solved on Orange Pi. They closed it because support is for Raspberry Pi only.

Any thoughts about getting this working is much appreciated


#5

I succesfully ported Astrobox to Orange Pi Zero (armbian Ubuntu 16 based).

Im messing with Wifi hotspot because the onboard WiFi supports concurrent mode (but manual wifi is working).

I need to check internal redirections because 127.0.0.1 is not working or me. I used the script with the static IP of the board right now.

Didn’t understand how init.d works ( or some method to start at boot), but I actually performed a re-installation from the WEB GUI and it is working at boot right now.

If you clone the Github repo, script does not work because \AstroBox\src\astroprint\static\css\gen and \AstroBox\src\astroprint\static\js\gen are “literally” empty (there is a blank “empty” file there").

*.scss (sass files) are not working with the github script in spite of I already installed sass and all the dependencies. You should mount raspberry pi image and copy the *.css missing files. Why? Because if you copy the entire Astrobox folder from Raspberry image, you wont be able to execute *.pyo files (optimiced bytecode). Someone told me *.pyo files are python compiled files from raspbian kernel so, I cannot execute them. In spite of using *.py files instead, Astrobox is loading very fast.

You also shoud copy the /etc/astrobox folder contains Astrobox configuration. If you miss that, script will return the last post error (No such file “/etc/astrobox/software.yaml”).

Im writting a script which is intended to work with almost all debian based distros. Im not sure but It worked installing java and all the neccesary dependencies, and then it execute Astrobox en mi Orange Pi Zero. When you go to the web page you can reinstall it and it works like a charm.

Next step is to build my own image when I solve all the little issues, but it is live!

I will keep this updated and maybe unoffical OrangePi Zero Github is coming.

Thanks you


#6

@Alberto, making a standalone astrobox fork based on our repo it’s fine and you can port it to any platform you wish. However if you intend that box to be connected to our cloud, be advised that it’s not as simple as you put it here.

  • The software.yaml file has information about the software version, platform and variant. You need a platform and variant Id from us or your software updates and connection won’t work properly.
  • .pyo files can be executed by adding python -OO to the executable command. In our case run
  • We add features quite frequently ( see the amount of parallel branches being developed ) having a fork of our code will quickly make such fork incompatible and hard to maintain (this might be fine if you don’t need the cloud). I recommend the fork to focus on build scripts for the OrangePI but leave the AstroBox core alone. We do welcome pull requests when there’s benefit for the AstroPrint community.

Also note that while personal use of the AstroBox software is fine with us, if you intend to use your fork to connect to our cloud in a commercial product, you need to get a commercial license from us.


#7

Thanks so much for the advise.

  • I had not touched Astrobox core at all but to copy .css and .js files I need from raspberry image. I still do not understand why the script does not take the sass and js files. As I performed factory reset from astrobox web settings, the system now has a “rpi” id variant and generated an astrobox-xxxx user. It connects perfectly to the cloud and it is fully functional. It also performs the initial config setup. At this time, Armbian and Raspbian looks very simmilar.

  • The main things I’m planning: Getting to work the wifi ap because the onboard supports concurrent mode. Next I have to solve the 10.10.0.1 not working to be fully compatible with your “First Time Setup” (i’m a little lost understanding local redirections on linux and learning about astrobox project structure). If you put the local IP of the device it works the same way and it performs the setup guide but, it is named and recognised as Raspberry device right now.

  • If I learn enough about this, the idea is to get a debian based hardware abstraction layer to get astroprint ported to other devices on the easy way. Maybe it is a crazy thought but I took me 3 days to get a functional port of astroprint on a 6€ board which is very promissing.

  • At the moment I am doing this “for fun” to try how viable is this board to use it on my printer project, because we are two students with not enought money at all :innocent:.
    In fact I have a planned call with yor mate Raul to talk about our project and get our license because we love Astroprint :smiley:. Otherwise we will use Raspberry Pi which is working perfect for us, but we are trying to minimize our production cost and to contribute to the community as much as possible.

Many thanks David


#8
  • USB serial port fully functional confirmed.
  • The printer is working over the integrated wifi and conected to Astroprint.
  • Astrobox seems to be capable of update and factory reset by the Web interface. It gets astrobox-xxxx id. At this moment it is recognised as a Raspberry. The first time It worked as “orangepizero” hostname the same way.
  • I’m creating a Github repo with some installation instructions to work with.

Next steps

  • To get the hotspot working
  • Cleaning up the internal network configuration.
  • Get Astroprint core untouched
  • Provide a flashable image.

#9

@Alberto, did you get an image ready and working? Right now I’m running Octoprint, but I’m very curious about using astroprint on my own OPiZero, as I do on my RPiZero.

Please report back here if you have a working image.

Mark


#10

Hey @Alberto,

Is there any update of your working. I am also looking forward to your ready-to-use image for Orange Pi.

Keep us update.

Thanks a lot.


#11

Dear @alberto,

looking forward for the imsage for Orange Pi ziero …

thanks


#12

Hi, I’m sorry, I was too bussy to continue the project, as soon as I could in a few weeks, I will continue to work on the project to bring you an update and a working image. Astroprint team is too bussy with Raspberry Pi to support any other board so I’m the only working on this for fun in my spare time. I’ll keep you updated!


#13

Good to hear you’re still active! Sorry to hear that the team won’t/ can’t support you. It would be very nice to have multi-platform support. Please do keep us posted. Thanks for taking the time!


#14

Hi Alberto,

I can help to prepare the image,since I am now installing astroprint source into orange pi zero, with some problem can need to figure out step by step …

Regards


#15

got the astroprint work on Orange Pi Zero …
but only with Ethernet, not the wifi
can’t update from web-gui

Can help to give hints on fixing this ?

Regards


#16

it’s seems I can only replace exisinting pi3 config with OpiZero, but can’t create a new configuration to use the cloud,
since there are box-id control the id connect to astroprint cloud …

we can use Pi Zero W but the CPU is not powerful as Opi Zero …:slight_smile:


#17

@fred2088, the box id is generated automatically by the box if it doesn’t exists. Make sure you don’t flash the following file in your image: <config_dir>/box-id, the default config dir is <astrobox_root>/local and the config dir in our image distribution is /etc/astrobox

You can indicate the config dir witht the ---config=<dir> parameter when executing the run command


#18

Just do a factory reset from the web interface and you are good to go. The python script should give you a fresh config with a new box-id automatically. After doing that I saw no difference between Raspberry pi and Orange pi Zero. I need to find the python method to perform it on the installation script but i’m learning python right now :’(


#19

im going to try on orange pro lite… do you think it is working


#20

@Alberto, @fred2088, guys, this kills me, please, can you share the step by step instructions how to install Astroprint on OrangePi Zero ? Or even better, share a flashable working image ? This would be a real life saver for many people with OPiZero… Thank you in advance :slight_smile: