Omega remote access with dataplicity with wormhole
-
Hello everyone, I want to share my project modifying the source code to port dataplicity to omega onion and any openwrt device, so, lets to start
check you have the last version of firmware
oupgrade
lets go to edit the repo list
vi /etc/opkg/distfeeds.conf
after that, you have to make a opkg update
opkg update
install the following packages
opkg install python-pip sudo shadow-useradd ca-certificates curl nano
so we have to upgrade pip and install the next packages
pip install --upgrade pip setuptools
pip install --upgrade egg supervisor
make these two lines one by one because all in the same line causes errors
create the next folders
mkdir /etc/supervisor/
mkdir /etc/supervisor/conf.d
create the supervisor config file in the first folder
nano /etc/supervisor/supervisord.conf
and paste the next code inside
; supervisor config file [unix_http_server] file=/var/run/supervisor.sock ; (the path to the socket file) chmod=0700 ; sockef file mode (default 0700) [supervisord] pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid) ; the below section must remain in the config file for RPC ; (supervisorctl/web interface) to work, additional interfaces may be ; added by defining them in separate rpcinterface: sections [rpcinterface:supervisor] supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface [supervisorctl] serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket ; The [include] section can just contain the "files" setting. This ; setting can list multiple files (separated by whitespace or ; newlines). It can also contain wildcards. The filenames are ; interpreted as relative to this file. Included files *cannot* ; include files themselves. [include] files = /etc/supervisor/conf.d/*.conf
the next step is download dataplicity code, create an account and add a device so you will see something like this
the token is different for each account, so you have to download the code to change some lines
download it with wgetwget https://www.dataplicity.com/"your_token.py"
after that, we have to delete some lines
nano "your_token.py"
find these selected lines and delete them
so, at this point you can install dataplicity, lets do it
finally we have to create a daemon of supervisor package
according this web we can do it with this codes
http://a0726h77.blogspot.com/2017/01/supervisord-on-openwrt.html
I prefer nano, so execute the next code and paste this
nano /etc/init.d/supervisor
#!/bin/sh /etc/rc.common # # AUTHOR: Takumi Sueda # # Start/stop/restart supervisor in OpenWrt. START=91 USE_PROCD=0 PROG=/usr/bin/supervisord DAEMON=${PROG} # Location of the pid file PIDFILE=/tmp/supervisord.pid # Config of supervisor CONFIG=/etc/supervisor/supervisord.conf start_service() { # $DAEMON -c $CONFIG -j $PIDFILE procd_open_instance procd_set_param command $PROG -c $CONFIG -j $PIDFILE procd_set_param respawn procd_close_instance touch $CONFIG } stop_service() { kill $(cat $PIDFILE) }
check that we change the config line by the new route "/etc/supervisor/supervisord.conf"
execute
chmod u+x /etc/init.d/supervisor
/etc/init.d/supervisor enable
/etc/init.d/supervisor start
cd /etc/rc.d
ln -s ../init.d/supervisor S99supervisor
If you do it right you will see something like this
click on the device and turn on the wormhole
install the legacy console on the omega
when you click the wormhole link it will be redirect to
https://something.dataplicity.io/OnionOS/
change it for
https://something.dataplicity.io/console/
and voila, you have terminal and a lot of things remotely without dmz and free!
don't forget, you can use it with webcam app
I will appreciate if someone helps me to improve the code and do it fully working without wormhole or adding something else, the reboot button works fine
-
Hi David,
Great post, it was very easy to follow and all works great however the terminal does not.
All I see is
Any ideas ?
PS a warning at the start about oupgrade resetting previous configurations would be handy.