Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raspberry Pi support #30

Open
jelmerkoppelmans opened this issue Jul 25, 2015 · 36 comments
Open

Raspberry Pi support #30

jelmerkoppelmans opened this issue Jul 25, 2015 · 36 comments

Comments

@jelmerkoppelmans
Copy link

Would that be possible? Currently running raspbian, but I get hit with a lot of installation and configuration.

Do you have any guides or tips?

@jelmerkoppelmans jelmerkoppelmans changed the title use on raspberry pui use on raspberry pi Jul 25, 2015
@sorccu
Copy link
Member

sorccu commented Jul 26, 2015

Running a provider on a Pi (v2) is definitely something we want to support, but as we currently depend on Node.js I assume it would be a bit of a hurdle. I currently don't have a Pi to test with, so there's not much I can say right now. Definitely interested in hearing if you or someone else manages to get it to work.

@sorccu
Copy link
Member

sorccu commented Jul 27, 2015

I ordered a Pi 2, will update the ticket once there's progress. No promises
though.

On Sunday, July 26, 2015, Jelmer Koppelmans notifications@github.com
wrote:


Reply to this email directly or view it on GitHub
#30.

@jelmerkoppelmans
Copy link
Author

Awesome! This might come in handy:

@sorccu
Copy link
Member

sorccu commented Jul 27, 2015

Actually I'm not planning on running RethinkDB on the RPI, it needs more RAM for smooth operation. The rest of STF may run OK, but I'm mostly interested in running the device provider there and nothing else. It would connect to another server running the app itself.

@arcxyz
Copy link

arcxyz commented Jul 27, 2015

I have successfully running on RPi 2 (archlinux) also with RethinkDB. And it works, but only tested with 6 devices.
Note that RethinkDB have an experimental support on ARM platforms and you may need to compile on your own.

Thanks for this great project! 😉

@sorccu
Copy link
Member

sorccu commented Jul 27, 2015

That's awesome! I guess you didn't bother with docker and just did the whole installation yourself?

@arcxyz
Copy link

arcxyz commented Jul 27, 2015

Didn't try with docker, but it would be great if it works!

@jelmerkoppelmans
Copy link
Author

@arcxyz could you give me a short guide on how you set up the install?

@arcxyz
Copy link

arcxyz commented Jul 27, 2015

Taking a clean Archlinux install as a starting point, run these commands (extracted from our Pi history):

# System Upgrade
pacman -Syu
# STF deps:
pacman -S android-tools nodejs npm graphicsmagick zeromq pkg-config 
# RethinkDB build dependencies
pacman -S base-devel # Select ALL
pacman -S libsodium libpgm protobuf protobuf-c libboost boost boost-libs python2 gperftools python2-pip
# Download rethinkDB sources
curl -O http://download.rethinkdb.com/dist/rethinkdb-2.0.4.tgz
tar zxvf rethinkdb-2.0.4.tgz
 # Change default python version 
ln -sf /usr/bin/python2.7 /usr/bin/python
# Configure and build! (it may take hours on Pi)
cd rethinkdb-2.0.4
./configure --with-system-malloc --allow-fetch
make
make install
# finally install stf
npm install -g stf

Let me know if you get errors compiling rethinkDB

@sorccu sorccu changed the title use on raspberry pi Raspberry Pi support Aug 7, 2015
@sorccu
Copy link
Member

sorccu commented Aug 7, 2015

Progress so far with my RPi2 running Arch Linux & Docker:

  • Built and pushed the base image to Docker Hub
  • Ran into problems with the stf Dockerfile where in ENV /path:$PATH the $PATH gets replaced with an empty string. Not sure why this is happening.

@sorccu
Copy link
Member

sorccu commented Aug 8, 2015

Figured out the cause, will wait till balena-io-library/resin-rpi-raspbian#3 gets fixed.

@sorccu
Copy link
Member

sorccu commented Aug 9, 2015

I added a temporary workaround, the STF image is now available as openstf/arm7hf-stf.

Still need to create an image for ADB.

@stoefln
Copy link

stoefln commented Sep 28, 2015

Anyone managed to get openstf working on raspbian?

@MichaelDepner
Copy link

I have some websocket connection issues. The video stream for devices is blank gray, but I'm pretty sure it's a problem in my network, still investigating. Apart from that, my pi running raspbian is working. Screenshots, remote control (again, without visible video), uploading apps, everything seems good.

I manually installed raspbian versions of adb and docker, and used the openstf/arm7hf-stf image. Since I am still working on network issues, I haven't stress or stability tested yet.

Important note: The pi is only running the stf-provider service file described in the deployment section, meaning that all the heavy lifting is being done on a beefy server in the cloud. I have no idea if it could handle running everything on its own.

@Tierney0115
Copy link

My raspberry Pi 2 lost device and reconnected every 2 or 3 mins. Does anyone use raspberry could last long time? I am wandering if all the Raspberry pi have the same problem. Thanks.

@sorccu
Copy link
Member

sorccu commented Nov 3, 2015

Make sure that your RPi is using a 2A power adapter. I find that providing any less power to the PI makes USB connections highly unstable. Also, power hungry devices tend to not work so well anyway. You could try increasing the USB current.

ODROID-XU4 is more expensive, but a much, much better fit with its Battery Charging 1.2 support, dedicated USB 3.0 bus, 1GB ethernet, eMMC 5.0 boot disk support, and 4A power adapter. The only downside is the somewhat noisy fan but I've replaced mine. All future ARM development will be done on ODROID-XU4.

@Tierney0115
Copy link

Hi sorccu,
Thank you for your advice. I am considering using ODROID-XU4 instead of Raspberry Pi.

@Tierney0115
Copy link

@sorccu
One more shot question, which USB hub are you using with ODROID-XU4? Is this one Plugable's USB 2.0 7 Port Hub with 60W Power Adapter?
Thanks.

@sorccu
Copy link
Member

sorccu commented Nov 12, 2015

Should be fine, but personally I'm not going to use a hub anymore, which should greatly increase reliability and concurrency. You should be able to buy 10 or more XU4s for the price of our recommended components and hubs. Depending on whether you decide to utilize the USB 2 port as well (I won't), 10 XU4s can support either 20 or 30 devices. An additional benefit is that since there are fewer devices per machine, it becomes much less annoying to update & reboot the machines since you'll only lose 1-2 devices per machine. You could even set up automatic updates and reboots without having to worry too much about anything. Also, since you can give each provider a unique name, it should become way easier to physically find a missing or misbehaving device.

I'm not done with my own setup yet, though.

@Tierney0115
Copy link

@sorccu
Thank you for your advice :)

@kinimatt
Copy link

kinimatt commented Dec 2, 2015

Running on Raspberry PI 2 with Raspbian, STF not showing any devices.

I'm running everything on it. Got docker, ADB , rethinkdb all working on host. Tried docker image. Stf loads and can access web page. But when it loads, I see following message while loading

INF/provider 36 [] Sending output to "tcp://127.0.0.1:7116"
INF/provider 36 [
] Receiving input from "tcp://127.0.0.1:7114"
Unhandled rejection Error: spawn adb ENOENT
at exports._errnoException (util.js:746:11)
at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
at child_process.js:1144:20
at process._tickCallback (node.js:355:11)
INF/storage:temp 56 [*] Listening on port 7102

@Tierney0115
Copy link

@sorccu
I am using the Odroid XU4 for about a week. The stability of USB port is still not very good. It often reconnect about 5 to 6 hour with 3 devices connecting. Have you tested ODroid already? Could you give me some advice about enhance the stability. Thanks.

@sorccu
Copy link
Member

sorccu commented Dec 9, 2015

Could you try this to see if it helps at all? Apparently there were some problems with their manufacturing process that left the USB 3 ports a bit dirty on some boards. Try cleaning them and report back.

@Tierney0115
Copy link

Thank you for your help. I have tried this method but not work for my ODroid. I have many Odroid all have the same problem. Finally we choose USB HUB 2.0 to enhance the stability.

@sorccu
Copy link
Member

sorccu commented Dec 30, 2015

That's weird. My XU4 is very stable, although I only have one Nexus 9
connected to one of the USB 3 ports. In the past 10 days the device worker
has only died once, however it seems to have been due to Android stopping
the STFService rather than the USB connection actually dying.

On Wed, Dec 30, 2015 at 12:49 PM, Tierney0115 notifications@github.com
wrote:

Thank you for your help. I have tried this method but not work for my
ODroid. I have many Odroid all have the same problem. Finally we choose USB
HUB 2.0 to enhance the stability.


Reply to this email directly or view it on GitHub
#30 (comment).

@sorccu
Copy link
Member

sorccu commented Feb 25, 2016

We now have an automated nightly build for armv7l available at https://hub.docker.com/r/openstf/stf-armv7l, and as a bonus it's a lot smaller than before.

The one thing that's missing is a good, up to date adb container for arm. It isn't easy to compile adb separately, unfortunately.

@capricornuscipher
Copy link

I have Open STF running on Raspbian on a Raspberry Pi 3. Still polishing the install and run process. Looking forward to helping contribute any results from my own farm to STF.

@denis99999
Copy link
Contributor

Hi Will (capricornuscipher),
May you publish your installation procedure of STF on Raspbian/PI3 ?
Thanks.

@pwicherski
Copy link

@capricornuscipher hiho :) Any progress?

@codeskyblue
Copy link
Member

codeskyblue commented Nov 12, 2016

@sorccu adb for arm can be download from here https://github.com/NetEaseGame/AutomatorX/releases/tag/1.0.12

@capricornuscipher
Copy link

@denis99999 @pwicherski I am working on some guides and will start publishing soon. I have it working on my RPi3. I've ran it both over Ethernet and WiFi. For now I'm have the RethinkDB for it running on it. I'm also currently attempting to create a WiFi hotspot from the Raspberry Pi for the smartphones. I'm also using python to control the phones over the IP address adb, but for now it's manually set up. I'm considering adding a python API to openSTF. Any suggestions are welcome.

@denis99999
Copy link
Contributor

denis99999 commented Jan 30, 2017 via email

@Nefariis
Copy link

Nefariis commented Mar 1, 2017

--edited--

After 8 hours of reading Im understanding docker and stf a little better ....

I re-flashed my xu4 and started over with docker - I will post something on my own thread when I get absolutely stuck.

Thanks

@sorccu
Copy link
Member

sorccu commented Mar 2, 2017

You can take a look at https://github.com/openstf/stf/blob/master/doc/DEPLOYMENT.md for guidance. It's not really meant for beginners but maybe it'll help.

Even though there's only a single docker image, you can launch any of the internal processes with it like the guide explains. It contains (almost) everything STF needs, with the exceptions being adb and rethinkdb.

Among other reasons, the benefit of supporting only a docker-based installation is that we mostly don't have to deal with people asking how to install dependencies, installing them incorrectly, using wrong versions, botching permissions, and we don't have to provide separate instructions for the various Linux distributions out there or deal with their outdated packages.

@guandalf
Copy link

guandalf commented Dec 4, 2018

Anyone here considered building something on https://github.com/home-assistant/hassos ?

@maksimkravchenk
Copy link

@denis99999 @pwicherski I am working on some guides and will start publishing soon. I have it working on my RPi3. I've ran it both over Ethernet and WiFi. For now I'm have the RethinkDB for it running on it. I'm also currently attempting to create a WiFi hotspot from the Raspberry Pi for the smartphones. I'm also using python to control the phones over the IP address adb, but for now it's manually set up. I'm considering adding a python API to openSTF. Any suggestions are welcome.

Hi capricornuscipher. Can you share the guide for installation STF on RP3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests