Recent

Author Topic: Bizarre Behaviour - solved!  (Read 2463 times)

BLL

  • Sr. Member
  • ****
  • Posts: 276
Bizarre Behaviour - solved!
« on: November 11, 2015, 10:53:03 am »
Hi all,
Can anyone help? I am developing a program in lazarus and all was fine until yesterday, it started exhibiting very strange behaviour.
The program starts by reading gps NMEA data from ttyUSB0. This continues to work correctly.
Next, it sends a datetime string via ttyUSB1 to a PIC micro. The PIC receives this data correctly.
A timer component on the main form, with period one sec then reads system time/date and displays it - this is fine. It also calls a function to calculate moon phase and displays a picture in a TImage. This isn't happening although the function is being called!

Another timer, running in a separate thread, also with a 1s period repeatedly issues a # command to the PIC on ttyUSB1. This should cause the PIC to send a data string. The # is being sent but nothing is coming back. If, outside my program, I use putty to talk to the PIC, sending a # correctly returns the data!
Finally, another timer in a separate thread uses runCommand to run an external program which returns data from a weather station. Although the runCommand is happening, the program is not being called.

Thinking I had some something dastardly to my program's code, I ran a backup copy, taken the day before, when the program behaved fine and it too  exhibits exactly the same problems.
I have obviously tried shutting down and restarting the RasPi, but to no avail. I can see no problems in task manager. Other programs such as file manager work as usual. SSH from my laptop is fine.
So, I seem to have a bunch unrelated problems suddenly appearing.
Anyone got any ideas please?

RasPi with raspbian, fpc 3.1.1, lazarus 1.5, logged in as user pi with default password.

Turned out that it was trying to load a non-existent png into a TImage. The command was within a try/except construct, but still it stopped all sorts of other things from happening!
Don't understand why!

Brian
« Last Edit: November 11, 2015, 08:21:29 pm by BLL »

 

TinyPortal © 2005-2018