Python Script issue

Hi,

I am getting the message “Cannot receive LCD test from python script”, the script is not starting and I am not able to upload a hex file.

My Brewpi which is run on a Raspberry Pi and Arduino Uno was working absolutely fine until I replaced the 2 temperature probes with longer ones (same type, just longer). Ever since then I have been getting the issue as above. I formatted and did a full reinstall of everything and it hasn’t fixed the issue. I’ve put the old shorter temperature probes back on, tried a different usb cable and a more powerful power supply for the Raspberry Pi with no change to the problem. I’ve also checked the wiring etc and that all seems fine.

I have very limited ability with Linux so laymans terms suggestions are best!

Does anyone have any ideas on what may be up? Is it likely hardware or software and what should I try next? I’m just baffled as to how it was working fine and then developed this issue when changing the temperature probes. My friend changed his probes to identical ones to mine with no issues.

Cheers,
Dane.

I sometimes have the same issues but I am using the BrewPi Spark. For me it works fine to disconnect the Brewpi form the Raspberry Pi, restart die Raspberry Pi, wait until the log in webinterface says, that no machine could be found on the serial ports and then to connect the powered off BrewPi Spark. I think it might work with the arduino on the same way.

What does the log file say?

If you cannot access it via the web interface, look in /home/brewpi/logs/stderr.txt ?

Can you still see the arduino on the system? Check with:

ls /dev/ttyA*

It is not ttyAMA0

Do you see it with nothing plugged in the Arduino?

Norn - Tried that with no luck but thatnks anyway.

Elco - I did sudo nano /home/brewpi/logs/stderr.txt and it just came up with a blank file. There is nothing showing in the logs section of the web interface.

ls /dev/ttyA* returns:
/dev/ttyACM0 /dev/ttyAMA0

Thanks.

If you start the script manually, does it run?

sudo -u brewpi python /home/brewpi/brewpi.py

If that’s the case, can you show paste the contents of /etc/cron.d/brewpi?
Starting the script is managed by that cron job.

I was having the same issue. It looks like the brewpi Tools doesn’t check if pyserial is up to date.

Hi Elco,

Yes the script does start if run manually with that line.

The contents of /etc/cron.d/brewpi is

stderrpath="/home/brewpi/logs/stderr.txt"
stdoutpath="/home/brewpi/logs/stdout.txt"
scriptpath="/home/brewpi"
entries=“brewpi”
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^$

Where do I go from here?

Cheers,
Dane.

That does not look correct.
Please delete that file.

The run:

 sudo /home/brewpi/utils/updateCron.sh

In addition to the above post, here is some more information.

When I try to install a hex it says:

Could not read boards.txt from Arduino, probably because Arduino has not been installed
Please install it with: sudo apt-get install arduino-core

So i tried sudo apt-get install arduino-core and get a whole heap of rubbish regarding ‘something wicked happened’ and errors about the mirrors. I can’t post it here as I’m a new user and it won’t allow me to post all the links.

Could you please tell me the code to be able to delete /etc/cron.d/brewpi.

Thanks.

sudo rm /etc/cron.d/brewpi

Excellent, all working now Elco, you are a genius.

I am still baffled as to how something software related had shit itself when I changed the temp. probes over.

Cheers and beers!

Digging up a really old post here but my issue seems to be similar.

Everything was fine until the web interface said he script was not running, but the script is running on the Arduino. The relays are still firing to hold the temp.

If I manually run the script the web interface will show it running, but as soon as I close the terminal the script stops.

I’ve run the cron update.

The only thing I see in the stderr is that the wifi checker failed which seems odd since I can get to it by wifi by the web interface or the terminal.

Any ideas?

Let’s get some terminology right:

  • The Arduino runs the control algorithm in it’s firmware
  • The BrewPi python script runs on the raspberry pi and connects to the Arduino via Serial
  • The web interface connects to the script.

So this sentence does not make sense:

So check what is in /home/brewpi and check the log files in /home/brewpi/logs
Try running the fixPermissionss script too.

As always, thanks for the response and for being so quick about it too.
Sorry, I was sloppy in my use of terms.
The code in the Arduino seems to be running correctly.
The script on the RPI only seems to run when I ask it to manually and stops when I close the terminal or do a ctrl-c after manually running the script. If I don’t do a ctrl-c then I don’t get back to the RPI prompt.
I can access the web, but since the Python script is not running none of the data from the maintenance area is available.
I ran the fix permissions but that didn’t help. Looking at the output of the script I saw that it fixed the permissions for /var/www.
I wanted to have password control access remotely and in my fiddling to get that to work I believe that my web UI interface is in /var/www/html instead of the default.
I modified the script to use the new path. Ran the script again but still no joy.
Here are some images.

Apologies as I’m having to do this with my phone as my computer is currently not available.



Some basic checks:

  • Did you checkout the legacy branch on both repositories? Arduino is not supported anymore.
  • Does the web interface show a connection when you start the script manually?
  • Check the script path in config_user.php, if you have one.
  • Check the wwwPath in /home/brewpi/settings/config.cfg

Try deleting BEERSOCKET, so it is recreated.

When I initially set it up in March I did use the legacy. It has been running well since then.

The web interface does show connection when I manually start. As soon as I close the terminal session it returns to “script not running”.

Contents of config.cfg
wwwPath = /var/www/html/
dateTimeFormatDisplay = dd/mm/yy
beerName = Helles%20Yeah%2020170611
dataLogging = active
profileName = Lager
interval = 60.0

I changed it from /var/www/ to the current.

I deleted BEERSOCKET. I didn’t see it return I’m not sure what the trigger for that would be.

It may be running again now, I’ll give it a few minutes to see.

if everything works fine when you manually start the script, then the issue is the cron job.
It checks whether the script is running every minute and if it isn’t and should be it starts it.

Does the file /var/www/html/do_not_run_brewpi exist? That file is created when the script is stopped and prevents the script from running.

That file does exist in that directory

After deleting BEERSOCKET the Python script appears to be running again.

New issue is that the web site graph is not updating. It hasn’t moved for 2 hours. Rest of the website seems fine. The LCD box is populated and the values are changing.

Have not yet tried to stop the current session and start a new one. I’m going to try that now

Graph is working again.

Thanks for the help.

I’m not entirely sure everything is fixed, but at least it is working like it was before.

1 Like