to flash my system into S905X3 tvbox, you can follow this guide
follow guide only to: boot/flash armbian into tvbox (“insert dull toothpick into the AV hole…..“) and follow guide how to reinstall android distro on it if have troubbles to flash armbian (“insert dull toothpick into the AV hole…..”), nothing to edit (no config file to edit, nothing to fix, no bootloader to download, no firmware to apply, all is in my readt2go system), nothing to do more, all is ready to work, when you finally boot by armbian from microsd.
*
if armbian stucks on boot logo, download this release of android and flash on tvbox, then you can flash armbian with no pronlem:
connect hdmi screen and usb keybord, and login with pi user
(username: pi)
(password: pi)
then write:
sudo armbian-install [ENTER]
choice 501 from the list that appear (if your TVBOX is a X96 MAX Plus or follow list for your own TVBOX Model! and write correspondig code) and continue, choice then EXT4 (1) and confirm, wait some minutes the copy on emmc (arounf 5 minutes…)
when finished, you have to: remove microsd, unplug and replug power cable from tvbox.
after 1st boot, if cannot see an IP address on tvbox (you have to login into…), perform a reboot (appened to me…)
you have system ready and working on internal emmc.
now you can digit by shell:
sudo armbian-swap 1 [ENTER], wait, ok, you have enlarged to 1 Gb the Swap partition.
to continue, follow this guide from here after the string: “Let’s begin”
KlipperScreen doesn’t work with low resolution touch HDMI LCD, but on HD sceeen all works well (if somone has an idea to fix that problem, leave a comment about, I’ve tried a lot of fixes, nothing worked!)
Webcam seems to change /dev/video ID every time I turn OFF/ON TvBox, so or leave it ever ON, or try to fix device with this guide… in details, you can check into folder: /dev/v4l/by-id/, I’ve found 2 files, one is: usb-_Webcam_C170-video-index0 , so I’ve replaced into /home/pi/klipper_config/webcam.txt the line:
put ready2go Klippertv_RK3318.img.gz image into that folder
whe copied, insert microSD into TVBOX and turn it ON, multitool starts, and after some confirmation by USB Keyboard vonnected, you can do some operation, like:
erase internal flash, backup system and finally, you can Burn image to (TVBOX EMMC) flash image into TVBOX
9, shutdown when finished
restart, and EMMC after you copied intere system on it, may have wrong free space, so use the following command:
sudo /etc/init.d/resize2fs start [ENTER] (a message appears, press again [ENTER]) wait, confirm with [ENTER] and restart the tvbox when done! instead to give more size to the logs: write: sudo nano /etc/default/armbian-ramlog from: SIZE = 50M to: from: SIZE = 128M (ctrl + o to save the file, then [ENTER] to confirm, then ctrl + x to close); sudo reboot [ENTER] (to restart tvbox)
extract sdcard fromTVBOX and restart (Power ON) it, from now, you can follow original KlipperTV guide
plug & play system for TVBOX Android 9 with Allwinner H6 CPU.
What is it: KlippeTV is like minsailOS, but for Android TV Box (Cost: 30 euros with 2Giga RAM and 16 Giga on emmc 40 euros with 4/32 Giga), is the to be used as an alternative to Rapberry for klipper:
the original github from I built the klippertv image is here:
based on new: ———— OS: Armbian (23.02.0-trunk) aarch64 Kernel: 6.1.11-sunxi64
based on UBUNTU Jammy
all working as V3.2.6, but more now also leds: red on reboot/shutdown, blue when booted! plus if connected to local network, led is blue, while, if not connected for strange reasons, led falshed red/blue, until connected again (fixed blue led!)
(to see local klipper IP on your LAN, in this new v23.02.0 release, to start klipperscreen on HDMI LCD, on ssh window write:
sudo systemctl enable KlipperScreen
sudo systemctl restart KlipperScreen
to see its own IP, within Klipperscreen:
tap on klipperscreen ‘settings’ icon, and then on ‘net’ icon (wifi icon), and you can see its own IP, btw, on PC browser you could type: klippertv.local to connect to it by mainsail.)
(updated to: 17.04.2023), all working, all working, also internal wifi, and remote KlipperScreen by RPC (remote desktop), KlipperScreen on HDMI and KlipperScreen for Android in wifi mode!, remember klipperscreen for android, you can use internal phone retro camera as klipper webcam, all explained below!)
I switched from mjpg-streamer to newest “crowsnest” for webcam(s), all infoshere
and, plus, FROM version 3.2.1 are enabled the Kernel Drivers for CANBUS Modules, so now you can use canbus modules connected on Klippertv Box USB PORT like theese:
or
you will already have:
klipper
mainsail & fluidd (on port 81)
klipperscreen & klipperscreen for Android (you can have one or both!)
working webcam (may needs some config edit!)
Shell GCode
kiauh (if you want to install something else, like telegram bot i.e.!)
to access kiauh from shell , enter as pi user and type: cd kiauh (enter) bash kiauh.sh (enter)
necessary tools:
WinSCP: to connect in ssh to the tvbox as if it were an explorer
Putty: SSH client
Balenaetcher: to write the system on a microSD (at least 8 Giga) 1 USB keyboard to connect to the tvbox for the first config 1 HDMI touch screen for early setups and KlipperScreen An old android phone/tablet for KlipeprScreen for android What else? I do not know….
Let’s begin:
buy an android TVBOX with H6 CPU among the many I recommend: T95 mini(2/16 giga) or T95 MAX (4/32 or 4/64 Giga)
for the T95 MAX or equivalen tvbox, the kernel can see only 3 gigs of RAM also if the tvbox has 4gigs, is a kernel limit (but 3 is even better than 2!) also if to have klipper full working 2/16Gigs, are good (think that tons of people use a raspberry 3 that has only 1Giga of RAM…)
if you want 5G wifi instead of 2.4 Ghz internal one, or if internal doesn’t work, for unknown reasons you can use one of theese external usb/wifi adapter:
download klipperTV image, download and install balenaetcher, format a microSD (>=8 Gigs) in NTFS Format; run balenaetcher, and load the KlipperTV.img.gz file, select the microsd (already inserted in the pc’ USB) and write the system. what inside? All, as shown in image, Once done insert the microsd in the TVBOX, connect it to an HDMI screen, a keyboard and a LAN cable Turn on the tvbox, after the classic linux boot (maybe reboots itself once, and it can stop for some time during second boot ), it asks you to login.
TAKE CARE: 1st BOOT CAN TAKE UNTIL 10 MINUTES…so WAIT…
If after 10 minutes cannot see login shell, unplug and replug power on TVBOX and WAIT…
You have 2 users: root (root password) and pi (pi password) to use the kiauh tool, login with user pi, and write: cd kiauh bash kiauh.sh and you will see:
to set static IP address you have to use armbian-config tool, how:
write: sudo armbian-config
(if you want WIFI, insert usb/wifi module and choice:)
Network menu-> Wifi (manage….)->select preferred wifi SSID confirm, insert password and you are on wifi now! )
to move: up / down arrows, to scroll through the items, [SPACE] to select acheckbox, [TAB] toto go to [OK]/[CANCEL], [Enter] to Accept the selection) .
and…select and…continue… …and finally…
Now you will have to transfer the system to emmc (if tvbox had any, the tvboxQ Plus for example had NAND Flash , not compatible). Go to armbian-configSelect item 1 (System): , then:
and finally:
select item ne 2 (not 5..) select EXT4 file system and confirm with [ok] , wait until ask you to shutdown system.
now:
power off tvbox, remove microSD from its slot (cos you have installed system on internal EMMC!) wait some second and power ON left HDMI connected, (if iet connected to your touch screen, otherwise, connect your HDMI touchscreen to the TVBOX ) and reboot KlipperTV in shell write: sudo reboot [ENTER] to see klipperscreen on HDMI you have to enable KlipperScreen service, disabled by Default, so write: sudo systemctl enable KlipperScreen [Enter] and then: sudo systemctl restart KlipperScreen [Enter] wait 10 seconds and your screen will show KlipperScreen working. for touch screen
If issues: sudo mv /etc/X11/xorg.conf.d/50-fbturbo.conf /etc/X11/xorg.conf.d/50-fbturbo.conf.bak sudo service KlipperScreen restart
to see klipperscreen on remote pc you have to install some other packages:
P.S.: On last Allwinner H6 release is iet installed and working remote KlipperScreen, only have to write on PC search “remote desktop”, run it and insert KlipperTV IP, then username and password (in my case: pi as username and pi as password!) and connect to see remotelly KlipperScreen!
—
for other releases (RK3318 and Amlogic S905X3) you have to install below modules as described!
sudo apt install xrdp
and
sudo apt install xorgxrdp
nano /home/pi/.xsession
Paste this 2 lines:
cd /home/pi/KlipperScreen
exec /home/pi/.KlipperScreen-env/bin/python /home/pi/KlipperScreen/screen.py
Reboot the pi and connect with your username and password in your RDP app of choice.
I’ve tested on 5” HDMI touch screen and all worked well,both klipperscreen and touches! if you have troubbles on your own touch screen you can: run calibrator, in shell write: sudo DISPLAY=:0 xinput_calibrator [ENTER] now you can calibrate your touchscreen in the 4 corners, wait and klipperscreen appears again, check if touch works well. to use ever same calibration write: sudo nano /usr/share/X11/xorg.conf.d/99-calibration.conf copy/paste the shell output, in my case:
[ctrl+o to save [ENTER] to confirm, ctrl+x to close file] (this is my own touchscreen model: "WaveShare ws170120", maybe your will be different:) if you need to swap axis, replace: Option "SwapAxes" "0" with Option "SwapAxes" "1" if need to invert axes next line (under Option "SwapAxes" "1") : Option "InvertX" "0" ### or "1" Option "InvertY" "0" ### or "1" (you can run calibrator to get correct x,y positions.) in shell write:
Well done! now you can connect to it in remote, unplug USB Keyoard to connect from your PC with SSH (explorer and shell) , you have to install putty; and WinCSP. run winCSP and when ask for new connection, you only enter:
yout KlipperTV IP, username (pi) and password (pi), click on connect:
left TAB is you PC (you can select a specific folder to see content), right TAB is KlipperTV you can select a specific folder to see content) in top/left corner, you can see [2 pc] icon, click on that icon and you open a SSH shell (you had installed Putty, before….) (it asks for pi use password… you know it…) so, connect with SSH Shell: you can change root and pi passwords, write: sudo passwd root [ENTER] (to change root user password!) write twice the new root user password and: sudo passwd pi [ENTER] …as before…. info: if the system is on NAND you can expand the system on the microsd (or maybe also on EMMC after you copied intere system on it) with the following command:
sudo /etc/init.d/resize2fs start [ENTER] (a message appears, press again [ENTER]) wait, confirm with [ENTER] and restart the tvbox when done! instead to give more size to the logs: write: sudo nano /etc/default/armbian-ramlog from: SIZE = 50M to: from: SIZE = 128M (ctrl + o to save the file, then [ENTER] to confirm, then ctrl + x to close); sudo reboot [ENTER] (to restart tvbox)
to install minimal python 2 (yes is deprecated from years, but for robin nano 1.2, to build firmware, you need it!)
write in shell:
sudo apt install python2-minimal [ENTER]
well, now you Know how…. let’s go on android phone to enable klipper screen on it you’ll have to
1) Enable developer settings: 2) Enable usb debugging 3) Install the server to view klipperscreen. let’s begin
1:
ITA a. Tocca Impostazioni. b. Tocca Info sul telefono. c. Tocca il campo Numero build 7 volte.
ENG: a. tap on settings. b. tap on phone Info . c. tap on build number 7 times.
Exit, you will now have a new item in the menus [developer options] 2: developer options, open that, go to the entry: USB DEBUG, enable it, finished 3: if you have an active google account on your phone from play store write:xserver XSDL If you don’t have google account, by a web browser (like chrome) browse here:https://www.apkfollow.com/app/it/xserverxsdl/ x.org.server/ Download and install (the apk icon is this … do not install anything else by mistake 🙂
this icon is from the right apk, not other ones!
start that app installed on your phone, [CHANGE DEVICE CONFIGURATION] appears at the top of it, If doen’t appears close the server (cellphone app) and restart it If it still appears, close the server, connect the phone to the TVBOX on usb and restart the server from the phone, tap on it ([CHANGE DEVICECONFIGURATION]) Then scroll down the list to: [Mouse Emulation] Then again: [MouseEmulation Mode] And finally select the item: [Desktop, No Emulation] Scroll down and tap on [OK] (or CLOSE I don’t remember) Still [OK]. A blue screen with your mobile phone’s IP address appears. (To have a static IP the procedure is similar to the one above for the TVBOX Ok…) Let’s go to WINCSP Go to the tvbox /home/pi/KlipperScreen/ Folder and open(double click on) the file: launch_klipperscreen.sh Change IP from: DISPLAY = 192.168.1.58: 0 /home/pi/.KlipperScreenenv/bin/python3 /home/pi/KlipperScreen/screen.py to: DISPLAY = PHONE IP:0 /home/pi/.KlipperScreenenv/ bin/python3/home/pi/KlipperScreen/screen.py So from: (example) 192.168.1.58:0 to 192.168.129:1 And you will have: DISPLAY= 192.168.1.129:1 /home/pi/.KlipperScreenenv/ bin/python3/home/pi/KlipperScreen/screen.py Save and close the file. If not already connected, connect or reconnect the phone on USB to theTVBOX, leave connected Restart the TVBOX from shell write: sudo reboot[ENTER] enter the password of user pi (which is: pi) sending when you restart you willhave the klipperscreen screen on the phone, now you can also disconnect the usb that connects it to the tvbox and take it for a walk in the range of the WIFI with klipperscreen on the screen! WEBCAM SECTION: run the following SSH shell commands: install from SSHshell, by typing: sudo apt-get install ffmpeg v4l-utils [ENTER] (in the latest release of the KlipperTV system it may already be installed) then write on shell: v4l2-ctl --list-devices (and press [ENTER]) (shell output:) allwinner,sun50i-h6-vpu-g2-dec (platform: hantro-vpu): /dev/video2 cedrus (platform:cedrus): /dev/video0 sun50i-di (platform:sun50i-di): /dev/video1 Webcam C170: Webcam C170 (usb-5101000.usb-1): /dev/video3 /dev/video4
and here (Webcam C170: Webcam C170) we have to try: video3? or video4? or something else ???? open with WinCSP the file: /home/pi/klipper_config/ webcam.txt (double click on it.) edit this line: camera_usb_options="-r 640x480 -f 25 -d /dev/video2 -q 100" 1) change from camera_usb_options = "- r 640x480 -f 25 -d /dev/video2 -q100" to: camera_usb_options = "- r 640x480 -f 25 -d /dev/video3 -q 100"
while to check rela supported resolution (– r 640×480 in the example) insert webcam USB into a PC a and open this site
so change: 640×480 with 1920×1080 (supported in my case) then reboot the webcamd service by writing from shell: sudo systemctl restart webcamd [ENTER] from browser (chrome for example) write: http://TvBox_IP/webcam/?action=stream example: http://192.168.1.44/webcam/?action=stream if you see webcam, ok, otherwise try another input (video3 or video4 or etc) same from point 1 webcam will work on own video device.
WEBCAM from Android camera (same device that you used for KlipperScreen)
and on mainsail you have only add new webcam as in picture:
so, string is:
http://ip_of_your_android_phone:8080/video
in both stream and snapshot and all will work!
so, you have now old android phone/tablet that works with klipperscreen on, and as printer webcam! 😉
the guide to use a Raspberry PICO /clones that are good, working like original ones but less expensive, so I suggest raspberry PICO CLONE, connected by USB to KlipperTV TvBox and an adxl345 to make inputshaping tests, but also to have 40 free pin like raspberry pi 3/4 have.
the use of raspberry pico clone (less than 10 euros), depends if you have or not a SPI connector on your printer’s motherboard (usually EXP1 is a SPI port; SDCARD expansion is a SPI port), if present, you can use that connected drectly to adxl345 accelerometer, not need necessarily a raspberry pico!
now you can use also i2c protocol, as in thi image, with waweshare RP2040 (raspberry pico clone) and i2c accelerometer, like: GY-521 Modulo MPU-6050
*
*
*
now, to compile Klipper firmware for your own printer’s motherboard and install that firmware on it, follow official guide go