nipunbatra / Home_Deployment

http://iawe.github.io
7 stars 5 forks source link

Write Failed: Smart Meter Input/Output Error 5 #17

Closed nipunbatra closed 11 years ago

nipunbatra commented 11 years ago

Threads on SO suggest that it is due to h/w failure for serial port.

amarjeet-iiitd commented 11 years ago

I also saw once (a couple of days ago on my plug computer) that for some reason the script was not seeing anything on ttyUSB0. I took out the USB cable and inserted it back again and then it all worked fine. I have asked Inder to not hard code ttyUSB0 as the serial port to be used but instead search for the specific port in the dmesg log to decide which port should be used. This should probably solve the problem if it was for the port not found

nipunbatra commented 11 years ago

For now whenever such an exception occurs, i will check from the dmesg or kernel log if there is a port change. If a change from current port is detected, will make a serial connection to that port. But it is strange that while the plug computer/ RPi has not reset, the port connection was broken

nipunbatra commented 11 years ago

Now port is checked upon exception. Hopefully bug shouldn't repeat

nipunbatra commented 11 years ago

Program again crashed. This time i found that "None" was returned for the port match. Now, i am taking care of this special case and restarting the program if such an error occurs. If still this does not work out, would prefer restarting the OS, in case of such an event.

nipunbatra commented 11 years ago

Again the same exception occured. Alas the program didn't restart! Toy program had restarted, but not this one! Even rebooting in such a case shouldn't be a bad option. Interestingly, this is something which happens on RPi and not on Plug Computer (atleast not so frquently)

nipunbatra commented 11 years ago

OS reboot worked. For some reason RPi does not work with newer port. Does not get properly allocated. Hardly a minute worth data lost in the reboot process.