Raspberry Pi/networking problems, help appreciated


 

Kristian Ad

New member
Hi,

I've been running a 4.2 HM a while, but the last time I booted it up it didn't connect to the home wifi for unknown reasons (everything else worked fine, i.e. temperature readings, fan output et.c.). I disconnected the rPi (ver B) from the board, and have been running some standalone tests. It seems with a fresh heatermeter image, I can connect to the heatermeter network and have it connect to my home wifi (and I can still reach it with it's new LAN IP, so the wifi dongle works fine), but as soon as I reboot, the rPi creates the heatermeter network again, i.e. it seems the settings aren't saved, or that it connect for some other reason.

I've also tried with a new SDHC-card to rule out write errors..
Unfortunately I do not have another "old" rPi laying around, so I can't really test that part.. I have a few rPi 2's and 3's, but they wont work if I understand it correctly?

I'm a bit of a linux/rPi newb, so I'm not sure what to troubleshoot next? The output when booting up openwrt does not show anything that really screams "error" to me.. maybe these lines, which I don't recall on the first/fresh boot:

mmc0: missed completion of cmd 18 DMA (512/512 [1]/[1]) - ignoring it
mmc0: DMA IRQ 6 ignored - results were reset

Thanks in advance,
 
If the configuration isn't saving, that means it can't write to the SD card (filesystem read-only). If it is getting DMA errors and whatnot, Linux will switch the filesystem to read-only to prevent it from becoming corrupted. Maybe the contacts on the Pi have worn down a bit so it isn't making a good electrical connection? Perhaps rubbing them down with some alcohol and a cotton swab may help?
 
You can also try the snapshot image, which has more robust SD card support (but even I haven't tested this at all yet, it just finished compiling for the first time)
http://heatermeter.com/devel/snapshots/bcm2708/
openwrt-brcm2708-bcm2708-rpi-ext4-sdcard.img

(don't get one of the compressed files, they are all old versions. Haven't had a chance to clean up yet)
 
More confused than ever :-D

First of all, thanks for all your suggestions, much appreciated!

Have you tried entering your WiFi network name and password directly in the config.txt file?

I did that now, and it works fine on first boot after editing.. however when I reboot it starts up the heatermeter-network again, and when I examine config.txt afterwards my changes are commented out..?! :-/
I also tried changing the settings and then write-protecting config.txt (in windows), but the same thing happened again.
..Finally, even physically write-protecting the card does not help (works first boot after editing config.txt, second boot heatermeter-network is back up and the network settings in config.txt are commented out), very strange!!? (At least in windows i can not write to the sdcard if I change the small switch on the card, but linux still can?!)

If the configuration isn't saving, that means it can't write to the SD card (filesystem read-only). If it is getting DMA errors and whatnot, Linux will switch the filesystem to read-only to prevent it from becoming corrupted. Maybe the contacts on the Pi have worn down a bit so it isn't making a good electrical connection? Perhaps rubbing them down with some alcohol and a cotton swab may help?

You might be onto something.. I tried with isopropanol alcohol and cotton and it didn't help unfortunately.
I tried running e2fsck on mmcblk0p4 (after starting up and connecting to the dropbear ssh server), but am just getting the message

root@heatermeter:/mnt# e2fsck mmcblk0p4 -n
e2fsck 1.42.4 (12-June-2012)
e2fsck: Attempt to read block from filesystem resulted in short read while trying to open mmcblk0p4
Could this be a zero-length partition?

..I also tried with the new image, but am seeing the same problems (I also flashed it through the web ui).

I read that a Pi Zero can be used but have not been able to find a guide what needs to be done, could anyone direct me to it? Is it basically just adding wifi + soldering the "bridge" or whatever you call it. :-D
 
..and as a last(?) resort, I tried mounting system as read only (ro in cmdline.txt), and it still overwrites the settings in config.txt (I guess it is later remounted as rw?).

If I edit config.txt using vi after the system has booted, it already has commented out the settings.. Maybe I could create a script that when the boot is finished, replaces config.txt with one with my network settings .. at every boot. Not really getting to the bottom of the problem then of course, but maybe what I will need to settle for?


..And after digging a bit further, I found the /etc/init.d/config_restore script. I deleted the part which comments out wifi settings in config.txt which at least makes sure that the settings stay, but maybe I should disable this script altogether? (Still, doesn't solve the problem of why it is running in the first place..)
 
Last edited:
All of the wifi_* settings in config.txt are automatically commented out once they have been read.

I just learned half a minute ago. :-D
Do you think I should disable the complete config_restore script, or how could I dig into the issue further?

I could also mention that the new image does not create a heatermeter-wifi or anything to connect to (as a fresh build, i.e. no edits) to start with. And if I edit config.txt, it still does not connect to my wifi.

Thanks,
Kristian
 
Last edited:
Have you tried connecting through LAN instead of the WiFi AP to link your WiFi? Don't know how this would help, but it's worth a try.
 
I just learned half a minute ago. :-D
Do you think I should disable the complete config_restore script, or how could I dig into the issue further?

I could also mention that the new image does not create a heatermeter-wifi or anything to connect to (as a fresh build, i.e. no edits) to start with. And if I edit config.txt, it still does not connect to my wifi.

Thanks,
Kristian

No, that won't fix anything. I would bet that the wifi settings are getting saved to /etc/config/wireless just fine.

Were any changes made to your home wifi router or anything? These wifi dongles require 2.4GHz wireless. If you've made the move to only 5GHz wireless, that could be the reason it's not working anymore.

I would also reboot the wifi router. I've had some whacky wireless things happen at home and the only thing that seemed to clear it up was a good old fashion power cycle.
 
WBegg: I haven't tried LAN yet, perhaps I should try it.. But as I've written, I can connect to my router's wireles network just fine (either by changing config.txt or connecting to heatermeter network and then scanning and joining my wifi), but it seems the settings aren't saved (or overwritten by the config_restore-script).

Steve_M: I have actually changed router, but am using the same settings (SSID, password, encryption, and running both 2.4GHz and 5Ghz). ..And I've tried restarting it a few times. :-) ..I'm at work now, but I'll look into the /etc/config/wireless settings later today.
 
Last edited:
I was just going through this same issue on my own HeaterMeter 4.3 build. I finally overcame it by re-imaging the SD Card again, but not entering my wifi network details into the Config file. This forced it into creating the HeaterMeter network when it booted. After that, I was able to connect my computer to that network, and using the default ip address (192.168.200.1), log into the management settings and connect it to my home wifi network. Once I did that it got a new ip address via DHCP from my network and it has been fine ever since. Hopefully you find a solution to your problem, even if my process doesn't work for you.
 

 

Back
Top