Raspberry PI 3B and Wifi

I am trying to build a headless remote device… and just not happy at the moment…

It is remote - needing two hours drive to get to the unit should I need to… Which has become a pain…

I use VNC to remote log into the device, works well… but sometimes when I do a reboot because of some change to the software I am running… It basically looses connectivity on the wifi - and ummm I can no longer access via VNC and of course it no longer does its regular reporting (its a weather station and water tank level monitor).

I then need to turn the power off, back on - and it all works good !

Yes I am aware of the loosing wifi every now and again - and I have a cron job running every 15 mins to check connectivity to the router, and to restart the wifi connectivity if needed…

But this is an issue on rebooting only… If I use the GUI, select Shutdown / Reboot - 90% of the time I loose connectivity - VNC can not find the device (its headless so I just assume its wifi ???)

If I turn the power off / on - it always comes good…

Any ideas for something more reliable ? Ethernet is not really an option - I need wifi… would I better using a USB wifi dongle instead of the onboard wifi…

Is the Raspberry Pi 4 got better wifi support ?

Im thinking of the only option to put a wifi power plug on the power supply so I can remotely turn it off and back on - but gee that seems overkill - there must be a more reliable way…

I haven’t had issues like you’re mentioning on my Pi 3’s but your reboot issue is more likely to be the VNC server that the WiFi. Assuming your WiFi is connected after the reboot try to SSH into the Pi. If the WiFi isn’t connected you have a WiFi configuration issue but it sounds like you do anyway.

If you can login with ssh run the following command:

sudo systemctl status vncserver-x11-serviced

You should have an output like this:

image

If it looks like this (or similar) you need to start the VNC service:

image

You can do that with this command:

sudo systemctl start vncserver-x11-serviced

If none of that works and you think it’s a WiFi issue come back to the forum and either I or somebody else can walk you through it.

p.s. I have a Pi 4 but haven’t found any difference in the WiFi but didn’t have issues with my Pi 3’s either.

Hi Keith,

I did experience a WiFi connect issue similar to what you mention with a Pi Zero. But I put that down to the WiFi signal level being on the edge of a reliable signal. Around -79 to -80dBm. You mention having to drive 2 hours to get to the remote location. In my experience WiFi does not cover any great distance. But your situation may be ok. You can use iwconfig to show the connected WiFi signal level.

As you are monitoring weather and tank level, have you considered using a LoRa radio link to send the data. The information to transfer would not be more than a few bytes. I mention this because I am looking into this for my own project where WiFi proved unreliable.

Regards
Jim

Love how helpful you guys are… some forums you never hear anything… but here I have always got some help - so great job guys!!!

James46717 I probably was not clear enough… The project will be sitting up at my farm which is a 2 hours drive away from where I live… so physically going to go and touch the unit is a painful trip. The Raspberry Pi sits within meters from the router and has good reception. So no need for LoRa or anything like that. Its just the distance away from where I live is the issue. I know the router is up and running, as other services like my irrigation / alarm are also connected to the same router - and I never have connectivity issues…

Shaun21504 - I don’t believe its the VNC Server not starting up… its set to auto login etc… and usually it works.

So I just tried the following test;

  • I SSH connected - logged in… could do stuff… all good. I then did a sudo restart…
  • Waited a couple of mins and tried to VNC - Nothing. tried to SSH - could not connect.

Turned power off, back on - can log back in via both SSH and VNC

Currently while I am debugging the unit, its located at the home I live - so I don’t have the travelling issue, not wanting to install it until I have it more reliable… So I am going to go and plug a hdmi monitor onto the unit and see what is happening… and hopefully I can reproduce the issue…

1 Like

Tried for 30 mins inside with the HDMI monitor plugged in and thought that I would not be able to replicate it… FINALLY got one and its kind of not what I was expecting…

I do a Reboot from the GUI menu…

Screen goes black, white curso flashing in top left and has the words at the bottom stating;

Plymouth-reboot.service

And it just hangs there - so to me its not the startup causing the hang, its actually the shutdown that is causing the issue ???

Does not happen all the time, only once in 20 tries. I have updated all the software / versions / kernel to the latest… I have even tried different SD cards…

Any clues as to why the shutdown does not always work ?

Interestingly - I walked away in disgust… and after about an hour, the reboot was completed… and it was accessible again…

hmmm… Maybe I am just being impatient that a reboot should take 1 min not over an hour? But who is to say that it might not come back at all next time?

Hi Keith,

Thanks for your reply.
I believe Plymouth is related to graphics according to the Raspberry Pi Forums.
Is your install of Raspbian Full or Lite ?

Pretty much all of my Raspberry stuff runs headless so I only install Lite, no graphics.
Maybe this is why the Plymouth-reboot.service takes so long, it is looking for something that is not there. But then it did do the same with a HDMI connected, hard to say. And it does seem to be a hit and miss process.

I have experienced intermittent problems with a particular brand of Micro-SD card, it was cheap but too slow for the Pi. Other cards have become corrupt to a certain extent when developing a project.

Hope you can sort it out. But the process taking a long time indicates a direction to follow.

Cheers
Jim

James thankyou. Knowing Olymouth relates to graphics is a good help…

It is a full install, on a sandisk high speed card… so I think I can eliminate that.

I could run it so it boots to command line - I don’t need the GUI really, although handy and easy to look at the SQL database and its just a simple easy way to point and click - its just running data gathering and sending txn’s…

I will have some more play time with it and see what I can find…

1 Like

OK So Far So Good…

At 730pm Saturday night - Id given up trying to solve it… and decided to start a fresh… But where to get a micro SD Card to completely start new…

LOL - Ended up at Coles Supermarket - got a high speed Toshiba 16gb card for $22, and after a couple of hours installing from NOOBS - I have a fresh new card.

Configured this, set up VNC… and for the last hour I have been rebooting after reboot after reboot… Takes about 90 seconds or so for each reboot - and I have done it around 20 to 30 times so far - and each time the reboot works…

So my issue must have been something corrupted or something installed…

I will just install package after package that I need and keep testing until its all done and working…

Such a long term process…

2 Likes

It looks like you’ve solved your problem but I was going to suggest checking that any external disk mounts are not causing the boot to hang. i.e. is there and entry in the fstab file but no corresponding physical disk? I was caught with this once. If you need to keep an entry in fstab without the disk present, make sure you have the “nofail” option in the fstab entry.
Also Keith, I’d be interested to know more about your weather station. What sensors do you have? How do you view the data etc. ? I’ve built a weather station using a Davis raingauge, Windsonic ultrasonic anemometer, DS18B20 thermometers, hygrometer and barometer and of course a Raspberry Pi.

Turns out partly solved… After spending 20+ hours rebuilding the new system. All going good - same problem has occurred… BUT I understand why now. The Weather software I am using from this vendor, if you run it in a terminal on its own, the reboot works fine… If you run it from rc.local and use nohup and a & as it continually runs… well that causes the reboot problem…

So I now know its the weather software not closing down as a service properly.

Amazing the vendor who originally told me I have a bad Raspberry or bad card, after proving it to them have come back to say - Oh yea… we have seen that before, we have 2 others with that issue…

So instead of wasting more time, I have asked them for a better way to run it… so that it will close… If I don’t hear from them this week, then I will need to invest my time…

I started this off over 15 years ago with a Davis 2 as well… good unit… But the wireless component has died and because I am in Australia, and I bought this originally from the US - I am told they use different frequencies and found it very difficult to get spare parts for it…

I bought this thing on ebay for my farm… which has worked well - similar to a davis… but its not as configurable, and its dying after 2 years…

I looked at a raspberry solution a couple of years ago and got all the parts for it… but never progressed…

In the last 2 months I decided to buy this one from switchdoc. I liked the look of it - simple Grove / hat - they had software… https://shop.switchdoc.com/products/skyweather-raspberry-pi-based-weather-station-kit-for-the-cloud Nice and easy, so bought the parts I needed, salvaged what I already have - it should be a nice easy project to build in a day…

Well I have spent over 100 hours on this thing… I did not realise at the time it was a kickstarter project, and the software was still evolving… I have done so much work in debugging it all… I think I started at v32 around 4 weeks ago - and I have done nothing but fix things where they are at v44 now…

Overall though - I have everything working now to my satisfaction… I just need the reboot fixed and I will be happy.

I have built 2 of these units, one for the house I live in Melbourne, and 1 for a farm I have 2 hours away. The farm one will be expanded to include reporting of the water tank level, which I integrated into their software…

Rather pleased, happy… But I just wanted a turnkey solution - didn’t realise I would be coding so much on it… But its been fun! Which reminds me - it does detect lightning and distance, but does no real reporting on it - so there we go one more thing to do…

Their hardware is I think well made, its evolving in changing the sensors - I added the VEML6075 for UV myself… Their software I think is actually well written, architecturally really good - but its trying to do lots of things, and the bugs I found are things they forgot about as they moved on to implementing something else new…

Argghhhh vendors… software developers…

Thanks for the info. The Switchdoc thing looks good but, as you say needed a lot more work. That seems typical of kickstarter stuff. I’ve been burnt with Kickstarter projects before and I’m very wary now.
Good that you’ve managed to get it working satisfactorily though. The lightning detector is interesting although single detector devices are never going to give you accurate location information for strikes.

The lightning detection only gives you a count and distance… up to 30km. Would need a few located around to try and do any type of triangulation… Found this ages ago though and looked interesting… http://en.blitzortung.org/cover_your_area.php

For me - the property is right in the middle of state forest, surrounding us in all directions… Had a few bush fires over the years, and luckily nothing drastic… but just nice to know if lightning is in the area and moving closer or away from us…

Have you looked at this:


I would add it to my weather station but lightning around here (southern Tasmania) is so rare it’s not worth it.
I’ve been looking at https://www.lightningmaps.org
It uses blitzortung data.

1 Like

That’s the exact thing I am using… you need to keep it 30cm+ away from the rpi as it gets interference and reports false lightning, otherwise it appears to be a great little unit… Simple to code… Can recommend it even just for the fun factor…

My setup currently uses;
BME680 to monitor the temp humid inside the box of all the parts,
AM2315 to measure the temp / humidity outside - although thinking of changing it to a SHT30 as apparently its more accurate with the RPi
TSL2591 to measure sunlight - was using the SI1145 but proved not to be accurate.
VEML6075 to measure UV light and to get UV Index
PPD42NS Air Quality Sensor (Optical Dust)
AS3935 for Lightning
Pi Camera to take a pic every 30 mins or so to form a daily stream of cloud movement…
Along with the Rain bucket / Wind Direction…

Oh and I am using the waterproof SEN0208 ultrasonic measurement for calculating the water level in the rain tank…

If I could think of any other sensors I would do it… LOL. Been reading how to detect snow, but it never snows in Melbourne or at the farm… Radiation sensor could be fun but seriously if it started detecting that outside it might be to late to run away… So for now that is my setup…

Not bad for my first raspberry Pi project… Which I love… what to build next!

My plan is to wait for the 4gb RPI4 - and I will use that as a Weewx server at home to do better reporting of my weather stations…

1 Like

@keith84844 how reliable is you ultrasonic tank level detector? Is it enclosed in a vertical tube to limit reflections etc? Are you doing temperature compensation? What resolution are you getting?