Hi
I’m new to raspberry shake - I’m trying to set it up so it will upload data over a Huawei 3g/4g dongle.
Currently I can see the data in SWARM and stationview when the Shake is connected via ethernet (eth0). If I remove the ethernet cable it will connect via the Huawei dongle which comes up as eth1.
at this point, I’m certain I sill have internet connectivity as I can ping 8.8.8.8 and use apt-get etc, but the stream in station view goes flat.
I managed to get it going again by tethering it to my phone, opening rs.local and then it started uploading, and kept doing so even when I removed the hotspot.
So what is happening?
It seems like the shake software isn’t able to switch between eth0 and eth1 automatically?
My guess is I need to figure out how to restart the data producer and/or data consumer from a script (or do whatever else happens when you visit rs.local)
Thanks in advance
hmm, not entirely sure what happened since the log files only indicate that the connection was lost to the server and that a reconnect failed since the machine name could not be resolved. perhaps the eth1 conversion doesn’t end up able to connect to a new DNS server?
i suspect this is the case since the WiFi connection probably uses the same DNS server as eth0 (all connected to the same local LAN), while the 4G connection does not.
to answer your other question, you can use the program rsh-restart, executed on the command line, to restart the data services, to see if this will help, but i’m not sure it will if my theory is correct. using the front-end config GUI, the Save and Restart button on the SETTINGS::General page will also restart the data services.
the other thing to try is to reboot the machine without eth0 being connected, but only the eth1 connected at startup, and see if this results in the unit being able to successfully connect.
the log file /opt/log/odf_SL_plugin.err will indicate whether a DNS resolution request fails.
Thanks for that Richard, especially the rsh-restart command.
I decided to go back to basics for some more testing.
I’ve flashed the recent v18 shake image for a clean start.
Basically I find that switching network interfaces will stop the data connection until rsh-restart has been run. This isn’t necessarliy a problem, just something I wanted to understand. It seems the data continues to be logged in any case.
A bit more detail follows:
When I run rsh-restart, it looks like it retrieves the IP address of one of the interfaces and presumably uses that to configure itself, so that may explain why it stops streaming when that IP address is no longer valid.
myshake@raspberryshake:/opt $ rsh-restart
2020 056 14:58:13: Ethernet is ON and WiFi interface is disabled. To enable, see file /opt/settings/user/enable-wifi.conf
2020 056 14:58:13: Retrieving IP Address of interface eth0: 129.215.138.84
2020 056 14:58:13: WARNING: This IP address indicates you are exposing your Shake directly to the internet at large.
2020 056 14:58:13: WARNING: This is discouraged since this exposes the Shake directly to bad actors.
2020 056 14:58:13: WARNING: Because this is an IoT unit, our recommendation is to place it on a local network
2020 056 14:58:13: WARNING: Where a router exists between the Shake and the internet.
2020 056 14:58:13: Generating necessary SC key files
2020 056 14:58:13: Configuring SEEDLINK...
2020 056 14:58:13: Configuring OWS
2020 056 14:58:13: Configuring HELI
myshake@raspberryshake:/opt $
You mention odf_SL_plugin.err
I see several lines like the following:
|2020 056 14:58:25>>|odf_SL_plugin: Program Starting...|
|2020 056 14:58:25>>|Unable to process configuration file '/opt/settings/user/UDP-data-streams.conf', format is invalid, cannot register UDP destinations.|
And sure enough, when I check UDP-data-streams.conf, it is an empty file:
myshake@raspberryshake:/opt $ ls /opt/settings/user/ -larth
total 24K
-rw-r–r-- 1 myshake myshake 266 Oct 18 2017 UDP-data-streams.conf.tpl
-rw-r–r-- 1 myshake myshake 477 May 29 2018 shake-UDP-local.py
-rw-r–r-- 1 myshake myshake 437 May 29 2018 shake-UDP-remote.py > -rw-r–r-- 1 root root 0 Feb 17 17:32 UDP-data-streams.conf
-rw-r–r-- 1 myshake myshake 124 Feb 18 16:53 enable-wifi.conf
drwxr-xr-x 2 myshake myshake 4.0K Feb 18 16:53 .
drwxr-xr-x 7 myshake myshake 4.0K Feb 18 16:54 …
Not sure if this is a red herring or not, but thought I’d mention it.
Like I say, this behaviour shouldn’t stop me doing what I’m trying to do.
I do have another question about data useage… but I’ll make a new post for that.
Thanks
the 2nd problem you highlight is not really a problem, just a friendly message that the UDS config file isn’t properly formatted, this means nothing when you are not forwarding data to a UDP port on the Shake Pi or another computer. you will probably get rid of this message if you configure a DATACAST (UDP) destination using the FE-config interface on page SETTINGS::DATACAST.
as for changing the network interface, i still wonder if this is explained by the change in DNS servers when switching from one to the other (ethernet to 4G dongle). in any case, i’m also wondering about the background: what is the use-case that you need for data to continue streaming to the server, preferably uninterrupted, even though you have switched physical network interfaces?
Hi Richard
to be honest its really just for development purposes that I’ll be switching between ethernet and 4G. In the field I expect it to be using a single interface only.
I just wanted to have a better understanding of this behaviour.
I think you are right about the DNS server thing, I’m on university campus so I believe its using a university DNS server, which isn’t available using the 4G dongle.