openstf / stf

Control and manage Android devices from your browser.
https://openstf.io
Other
13.17k stars 2.71k forks source link

Raspberry Pi support #30

Open jelmerkoppelmans opened 8 years ago

jelmerkoppelmans commented 8 years ago

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?

sorccu commented 8 years ago

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 commented 8 years ago

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 https://github.com/openstf/stf/issues/30.

jelmerkoppelmans commented 8 years ago

Awesome! This might come in handy:

sorccu commented 8 years ago

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 commented 8 years ago

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! :wink:

sorccu commented 8 years ago

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

arcxyz commented 8 years ago

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

jelmerkoppelmans commented 8 years ago

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

arcxyz commented 8 years ago

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 commented 8 years ago

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

sorccu commented 8 years ago

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

sorccu commented 8 years ago

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

Still need to create an image for ADB.

stoefln commented 8 years ago

Anyone managed to get openstf working on raspbian?

MichaelDepner commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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

Tierney0115 commented 8 years ago

@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 commented 8 years ago

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 commented 8 years ago

@sorccu Thank you for your advice :)

kinimatt commented 8 years ago

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 commented 8 years ago

@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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 https://github.com/openstf/stf/issues/30#issuecomment-167932224.

sorccu commented 8 years ago

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 commented 7 years ago

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 commented 7 years ago

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

pwicherski commented 7 years ago

@capricornuscipher hiho :) Any progress?

codeskyblue commented 7 years ago

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

capricornuscipher commented 7 years ago

@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 commented 7 years ago

Hi @pwicherskihttps://github.com/pwicherski, thank you very much for your answer, since my original request I also progress a lot in this domain and I see we are working exactly on the same issues. From my side I develop a CLI to control in an automatic way devices either in WIFI or usb.

@denis99999https://github.com/denis99999 @pwicherskihttps://github.com/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.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/openstf/stf/issues/30#issuecomment-275942509, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVtkCh9_-FMhIrs3s2t7dHYp4I5ZOp3jks5rXPNkgaJpZM4FfynM.


Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration, Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation. If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified. Thank you.

Nefariis commented 7 years ago

--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 commented 7 years ago

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 commented 5 years ago

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

maksimkravchenk commented 4 years ago

@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