Welcome! Log In Create A New Profile

Advanced

Installing OctoGoatBox on Keedox Android TV

Posted by nenadr 
Installing OctoGoatBox on Keedox Android TV
October 27, 2015 08:07PM
I have OctoPrint running on a Keedox Android TV, a fairly generic box, available on Amazon for $62. I wanted to document the steps in hope someone finds them useful. I used my regular Linux machine to set up the SD card. This requires sunxi-tools.

I found it handy to attach a HDMI TV, keyboard and mouse to the box until I got it to boot properly.

Hardware

Keedox is Allwinner A20 box, 1GB of memory, internal Wifi, SD card reader and two USB ports. Left USB port is fully functional and will support both USB stick (mounts as /dev/sda) and a webcam, while the only things I could get the right port to recognize are keyboard and mouse. I plugged in a hub into my left port to attach the printer and webcam.

SD card

The SD card reader is a bit flaky, the card can't be too slow or too fast. Too slow card will fail reading at boot with a "cluster error" message. My SanDisk Ultra Plus micro SD was, I guess, too fast - it would not boot *unless* a USB memory stick was plugged into either USB port. I ended up using a Class 4 SD card which I had lying around, but I'd suspect a slower Class 10 would work as well. So far I've found a 4GB card adequate. I used gparted to grow the root partition to use extra space on the card - the Bananian image allocates less than 2GB.

Setting up the boot

I used the current latest version 1508, Debian 8 Jessie, from Bananian website. It makes two partitions, one for boot and another for root. Boot has to be modified to make it work properly on Keedox. Boot contains sources for several different versions. I used straight BananaPi.

The boot loader will use the boot.scr file and will go down the "else" path. There is no need to modify this file unless you want to change the root file system. To change the file, take out the ASCII part and put it into boot.txt, edit and then use
mkimage -A arm -O linux -T script -C none -n "My Boot" -d boot.txt boot.scr
to make the new file.

The actual boot uses script.bin file that has to be modified to fix a SD card reader problem and enable the internal wifi. Make a copy of fex/BananaPi/script.fex.
Change sdc_detmode to 3 for mmc0 (else SD card boots, but never mounts)
Change wifi_para to sdio_wifi_para and prepend sdio_ to wifi_ items in the section. Change sdio_wifi_used to 1.
Compile the modified file via fex2bin script.fex script.bin and copy the script.bin to the root partition.

Your Keedox should now boot off the SD card. If you connect it to a wired network, it will get an IP via DHCP and you can ssh in.

WiFi setup

To enable the built-in Wifi interface, add to /etc/nework/interfaces the following lines, assuming your network is 192.168.1.*:

auto wlan0
iface wlan0 inet static
wpa-ssid your wireless network name
wpa-psk your wireless network password
address 192.168.1.120 -> I keep numbers above 100 for static IP numbers, use whatever works for your network
netmask 255.255.255.0
gateway 192.168.1.1

You should also comment out auto eth0 and iface eth0 lines, so it doesn't hang waiting for DHCP when not connected to the wired network.

OctoPrint setup

Follow the rest of the directions on the OctoGoatBox page. I then followed the Raspbian setup on the OctoPrint wiki: [github.com]

In the "basic setup" section, you also need to install gcc and libyaml-cpp-dev. If you plan to run a webcam, add the user pi to the "video" group.

I had spare an old Creative Technology, Ltd Live! Cam Socialize [VF0640] camera which doesn't support MJPEG. Iit worked fine without causing any print problems, though the OctoPrint wiki page warns of excessive CPU usage for transcoding. I used

/usr/local/bin/mjpg_streamer -i "input_uvc.so -y -fps 1" -o "output_http.so -w /usr/local/www"

to get 1fps timelapse. If your camera supports MJPEG, the "-y" option is not needed.

You might need to "ln -s /usr/include/libv4l1-videodev.h /usr/include/linux/videodev.h" if your mjpg-streamer compile doesn't find it.

If all is working well when you're done, you should be able to start and stop your webcam from the OctoPrint, see the timelapse, as well as shut down or restart your system.
Sorry, only registered users may post in this forum.

Click here to login