SG Button working in V2?

Sorry if this is already common knowledge, but how does the status/wifi_on/off/turn_off_SG-button work with the V2 software? I seem to have lost the button when upgrading the SW to V2. Still on GPIO17/18?

Hi Arne, the WiFi is turned on by default in V2. I believe the power draw is pretty minimal so that doesn’t tend to be an issue and it’s simpler this way as well. Did you want to be able to turn it off or are you just wondering?

As Josh mentions, the Hot-spot is on by default to keep things simpler. As far as I know, the button still works but I have to admit it that I haven’t tested that in a while ('been doing too much HW swapping and need to search for the button I was using…).

The indicator button does not work with the latest version of the V2 SW. I swapped a V1 SD card with a V2 and the functionality disappeared.

I find wifi on/off to be the the least issue. However, the heartbeat signal has been very handy when doing remote fault-finding with inexperienced field workers on site. An alternative option is of course to open the receiver box and check the RPI LED:s.

Also, I have learnt (but never experienced) that the SD card could get corrupted if abruptly disconnecting the power from a RPI. The pushbutton has offered a controlled way of powering down a receiver (“better safe than sorry”). This could also be achieved by SSH and a few simple commands, but that is nothing for the rookie.

1 Like

I dug out my adafruit hat with button and did some testing. The button more or less works as it used to. Single-press makes the LED blink once per second and supposedly when a tag is detected (I didn’t test that part). Double-press turns the hot-spot on/off. Long press (>3 secs) turns the rPi off.

What doesn’t work correctly and is confusing is that the button service thinks that the hotspot is initially off when in fact it’s on after a reboot. So the first double-press does nothing (turns the hot-spot on when it’s already on), but the second double-press does turn it off.

At least that’s what my testing shows. (I used the latest unreleased dev build but nothing has changed in that code in ages.) Please let me know if you observe something different and please either provide me with the log files so I can see what is failing.

NB, the pins are (from /var/log/syslog):

Sep  3 16:34:14 localhost sg-gestures[776]: Enabling GPIO 17 for LED and GPIO 18 for button
Sep  3 16:34:15 localhost sg-gestures[791]: Gestures on switch GPIO 18, LED on GPIO 17

NNB: I find the button difficult to use and turning hotspot on/off does take its time (30 seconds?). I have not really changed the original code. Maybe it’s worth reducing the functionality to hotspot on/off and shutdown (short press & long press) to make things less confusing and more reliable?

For fault finding the web interface provides a lot more information, so connecting to the hot-spot and pulling up the web interface should be preferred IMHO. The button blinks so much that I doubt an inexperienced field worker can reliably see when a test tag is detected… But I do understand that there’s value in having options…

I’ve never experienced the corruption either, but I also only use good SD cards… Note that you can turn the SG off using the web interface (on the software tab).

I’ve actually been noticing this surprisingly often lately, and ironically, more so after switching over entirely to higher quality cards! What I’ve been finding is that the data partition will appear “unallocated”. I’ve usually been able to recover it with R-Studio or similar software (the other R-Studio, not the R IDE) but it’s odd that it’s been so much more frequent. I don’t think I’m doing anything differently, and try to disconnect WiFi, close the browser, etc before powering down the Pi.

Interesting. This is if you remove the card and stick it into a windows laptop? The partition will definitely show as not-unmounted but I don’t know what to make of “unallocated”.

Correct. Usually when sticking it into a Windows computer it will be automatically mounted, though sometimes it won’t be and I have to assign a drive letter.

But in the case of it showing as “unallocated” I have to use service to “recover lost partitions” to access the data.