config.txt file entries get commented out afer each restart


 

BSmith-DE

New member
I am noticing that my HM config.txt gets completely commented restart. As we know this is where the WIFI settings are pulled from. I assume that the /boot/config.txt file has to be the file used for setting up the WIFI each time. Anything I can do to prevent this? Also, is there a way to reboot with doing a halt and then pulling the power cord?
 
That's not where the wifi settings are stored. That's where the wifi settings can be set. Once the settings have been used, it gets commented.
 
Also, is there a way to reboot with doing a halt and then pulling the power cord?
From the webui you can use System -> Reboot

But as far as the config.txt, Steve is right, they are read from config.txt and used to set the wifi settings stored in the main configuration system and then commented out of the config.txt so it won't reset on ever reboot.
 
Well for some reason after a restart my wifi settings aren't retained in what I assume is the /etc/config/wireless file? I have never been able to use the HM/LM GUI to change from AP mode to WIFI client mode - it has never worked. Is there a system config file I can edit or add that will default to my home WIFI and be retained? Does anyone have any suggestions?

Also, I should have clarified about restarting....I meant do a full reboot from the terminal or putty session.
 
sometimes the rPi is finicky about the SD card, you might try a different make/model/size card and see if your settings are retained. Bryan can fill you in on exactly where everything is stored, I think some is on the SD card and other parts in the ATMega itself. It's sounding to me like your rPi isn't saving your settings on the SD card or something. I've had issues before writing to a microSD card that drove me bonkers, then a different card worked like a charm....
 
/etc/config/wireless is the file. Populate your own and see if it sticks.

Here's an example based on mine:

Code:
# cat /etc/config/wireless 
config wifi-device 'radio0'
	option type 'mac80211'
	option phy 'phy0'
	option hwmode '11ng'	

config wifi-iface
	option device 'radio0'
	option network 'wwan'
	option mode 'sta'
	option ssid 'mywifissid'
	option encryption 'psk2'
	option key 'mywifipassword'
 
Yeah you might want to check your dmesg to make sure your Pi is not erroring out and setting the filesystem to readonly. If the config.txt is being changed to commented out, then HeaterMeter has already tried to modify your /etc/config/wireless. If the filesystem is readonly it can't tell the change didn't take effect though. If you ssh in and use `wifi-client (ssid) (password)` it should change /etc/config/wireless. If not, then do a `mount` command and see if the root filesystem is read-only. If it is, then it is probably because the SD card is getting errors and remounting it to protect the filesystem from corruption. In that case, try a different SD card.
 
Yea...I am done trying different SD cards. I have tried 6 different SD cards. I have tried Micro SD with adapters as well as the larger old school SD card. As far as brands go I have tried SanDisk and Lexar. As far as class of card I have done class 6 and class 10. For sizes I have done 8GB, 16 GB, & 32 GB. I have tried them from price range of $8-$20 SanDisk gold. Upon reboot I do sometimes see an error message.

I saw the wifi-client post from earlier. The computer accepts the command and I confirm it makes the changes by doing "less /etc/config/wireless". Is there a way to restart the wireless service in the middle of a run from a wireless putty terminal?(I am in the middle of a maiden voyage with my UDS with HM/LM - so far it runs like a champ). I would try to change over to my WIFI from the GUI, but that hasn't worked for me yet. I would venture to say that running the command "/etc/init.d/network restart" might do it, but I am not sure. I tried it and it junks up every interface that I have and I end up having to pull the plug because I can't connect to any interface. Then upon reboot, /etc/config/wireless settings are gone.

I don't know what dmesg is for sure. I want to say dmesg is the lines of text that cross the screen upon the initial boot up if you have an HDMI hooked up to a monitor.

Listed below is the results of the "mount" command output. I don't really understand what it's telling me and it looks like I get different results sometimes. Can someone enlighten me?

root@OpenWrt:~# mount
rootfs on / type rootfs (rw)
/dev/root on / type ext4 (rw,noatime,user_xattr,acl,barrier=1)
proc on /proc type proc (rw,noatime)
sysfs on /sys type sysfs (rw,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
tmpfs on /dev type tmpfs (rw,noatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,noatime,mode=600)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
/dev/mmcblk0p4 on /mnt/mmcblk0p4 type ext4 (rw,sync,relatime,user_xattr,barrier=1)
/dev/mmcblk0p1 on /boot type vfat (rw,sync,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)


I wish I could get a screen shot or text file of the boot screen to share. Any thoughts on that?
 
You can restart networking with this command:

Code:
/etc/init.d/network reload
You can see the boot log with this command:

Code:
dmesg

Or you can use this to show only the memory card info:

Code:
dmesg  | grep mmc

Your mount statement looks good.

rootfs on / type rootfs (rw) = The root filesystem mounted in read + write mode (rw). It would show (ro) if it was read only.
 
A huge thanks for all that have helped me out with their knowledge and input...

Ok......for now I cautiously say I found the resolution to the problem after what seems to be an endless search. I found a thread entitled "Heater Meter (R Pi) loses wireless config on every reboot" at http://tvwbb.com/showthread.php?65476-Heater-Meter-(R-Pi)-loses-wireless-config-on-every-reboot. The instructions to delete /etc/uci-defaults/linkmeter for the time being have solved the issue(s) that I have had with connecting to my wireless network. Like I mentioned I say it cautiously, but HOORAY!
(Now I can try to figure out how to get the alarms to alert my telephone and or email - which so far has been unsuccessful.)
 

 

Back
Top