So, I’ve looked around here quite a bit and haven’t really found an example, so I will ask.
After discussing quickly with Otso at Ruuvi, I will use a Gateway to maximise the range of the sensors I have bought but wish to store the data locally as internet access is difficult.
So I try to establish my RPi3b as base for logging the data. Why? I have extremely limited internet connectivity, and aim to ssh data across to home.
Home = Switzerland.
Sensor and Gateway physical location = New Zealand (offgrid limited data/internet).
So I want to configure the Gateway to send data to the wired LAN RPi3. I’d then ssh into the RPi occasionally during the hour or so a week that I set the SIM modem to boot up so I can then sftp data back to homebase. Hopefully, I can configure this here in CH, then take it to NZ (in 3 weeks) and leave it running there unattended for the year. Stability and reliability are key as no one will be there to reboot/restart anything.
So, how can I configure this so my RPi3 can collect/talk with the Gateway in a stand alone, no internet setting? The Gateway is used to maximise BLE range -hopefully +100m. And I’m trying to maximise reliability.
Some context. I last set up a network when the internet was 2y old… So I’ve lots of learning to catch up on here…
Additional Context, for many years I used large expensive linux based scientific equipment (nmr, x-ray diffraction, synchrotron light sources etc), but I stepped out of that area in 2013… So I’m not a complete idiot - just a scientist with a mission and a (now) short runway.
i am interested in this as well. for similar reasons. currently using venos os in a pi close to the remote sensor that is out of range of the ruuvi gateway.
can use victron vrm to check remotely the sensor.
I am using a PICO W to collect data from several ruuvitags in a remote location (on a sailboat). Not exactly the same constraints you are facing. But I am relying on intermittent/undependable wifi signals, so I programmed it to 1) time stamp each reading, 2) write timestamped tag data to a local csv file on the PICO, and then 3) attempt to write it to a google sheet if it can acheive a good wifi connection. If it posts successfully (PICO receives status code 200 after posting) then the csv row is deleted.
My key learning was to rely on the PICO’s own RAM to first hold all the data. Really simple by just assembling a string with “Time, Tag1, Tag2, etc” and writing to a local file. I chose the PICO because I’d heard of instability with reading/writing to the same R pi sim card on the standard Raspberry Pis. Perhaps you could try this csv approach, and just copy the stored csv data during your SIM connection time?
Hi Twisty,
Yes, for sure all I need is the RPi to write a continuous CSV file. I can easily tail it, or sftp it during the uptime.
Point is, how to get RPi to harvest the data, maybe the polling feature might work?
However, the initial struggle is to get the Gateway to send data regularly to the RPi, but as I don’t yet have an IP address (and i guess in the absence of internet connection I won’t have), I’m needing to get the RPI to LAN directly with the gateway. I’m learning all this netwrking stuff as I go, but possibly not fast enough.
re IP address.
Without a router , set up the Rpi using IP 192.168.1.1 (official local IP address range)
Configure its DHCP server daemon to lease addresses in range of 192.168.1.2, 192.168.1.63.
Gateway will request IP address and Rpi DHCP will give it an available address like 192.168.1.2. If connecting gateway to Rpi via ethernet cable you should be good to go.
Using wifi adds the complication of setting up wifi as “access point”
I would suggest using cron to start / stop the collection process letting it run for like a hour, writing to a new file for each run. That way if Rpi dies/power fails, data from at least the previous hour will be politely preserved. And you can delete old data after you retrieve it.