[Cialug] Python failing
Patrick Mcgillan
patrick.mcgillan at gmail.com
Thu Jun 30 07:00:46 CDT 2016
how interesting. there are no system logs. there is a dmesg log, but
nothing in it past boot of course. the version is known as bbq, picked for
its small foot print. not been worth it and am thinking of switching back
to regular debian.
I wonder if there is a missing package that could be loaded to restore
normal runtime logs. cron works and until you asked i assumed logs were
working, just never went and looked.
--
Patrick
On Wed, Jun 29, 2016 at 11:42 PM, David Champion <dchamp1337 at gmail.com>
wrote:
> Do you see any system messages about ttyUSB0 having issues?
>
> -dc
>
> On Wed, Jun 29, 2016 at 7:44 PM, Patrick Mcgillan <
> patrick.mcgillan at gmail.com> wrote:
>
> > The following script has been running fine for over a year. Now it is
> > stopping more than once a day. Kill program and restart and it again runs
> > fine for a while. Any thoughts? I know enough about python to be
> dangerous
> > to myself. n arduino uno is sending messages to the server running the
> > capture script.
> >
> > Patrick
> >
> >
> > #!/usr/bin/python
> >
> > import serial
> >
> > debug = 0
> >
> > MySerial = serial.Serial('/dev/ttyUSB0', 9600)
> >
> > while True:
> > data = MySerial.readline();
> > print "%s" % (data)
> >
> > if data.count(":") == 2: who,s1,s2 = data.split(":",3)
> > if data.count(":") == 3: who,s1,s2,s3 = data.split(":",4)
> > if data.count(":") == 4: who,s1,s2,s3,s4 = data.split(":",5)
> > if data.count(":") == 5: who,s1,s2,s3,s4,s5 = data.split(":",6)
> > if data.count(":") == 6: who,s1,s2,s3,s4,s5,s6 = data.split(":",7)
> >
> > if data.count(":") > 1:
> > fileout = open ('/var/local/Sensor/' + who + '-Data.txt', 'a');
> > fileout.write (data);
> > fileout.close();
> > if data.count(":") > 1:
> > fileout = open ('/var/local/Sensor/' + who + '-Last.txt', 'w');
> > fileout.write (data);
> > fileout.close();
> > _______________________________________________
> > Cialug mailing list
> > Cialug at cialug.org
> > http://cialug.org/mailman/listinfo/cialug
> >
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> http://cialug.org/mailman/listinfo/cialug
>
More information about the Cialug
mailing list