Closed Rudder2 closed 3 years ago
can you post the session file? odds are its an incomplete, even though there have been umpteen commits to try to fix this.
The session file has no Data in it. Would this create a HTTP Net 0 error on my Z?
probably - try deleting it and refresh
I deleted the file and rebooted the PiServer and still get the HTTP Net 0 error.
New systemctl status rc.local log: pi@raspberrypi:~ $ systemctl status rc.local ● rc-local.service - /etc/rc.local Compatibility Loaded: loaded (/lib/systemd/system/rc-local.service; enabled-runtime; vendor preset: enabled) Drop-In: /usr/lib/systemd/system/rc-local.service.d └─debian.conf /etc/systemd/system/rc-local.service.d └─ttyoutput.conf Active: active (running) since Sun 2021-02-14 00:08:09 EST; 19min ago Docs: man:systemd-rc-local-generator(8) Process: 270 ExecStart=/etc/rc.local start (code=exited, status=0/SUCCESS) Tasks: 1 (limit: 881) CGroup: /system.slice/rc-local.service └─366 python3 server.py 0.0.0.0 8080
Feb 14 00:07:12 raspberrypi systemd[1]: Starting /etc/rc.local Compatibility... Feb 14 00:08:09 raspberrypi systemd[1]: Started /etc/rc.local Compatibility. Feb 14 00:08:17 raspberrypi rc.local[270]: WebSocket transport not available. Install eventlet or gevent and gevent-websocket for improved performance. Feb 14 00:08:17 raspberrypi rc.local[270]: * Running on http://0.0.0.0:8080/ (Press CTRL+C to quit) Feb 14 00:26:12 raspberrypi rc.local[270]: 127.0.0.1 - - [14/Feb/2021 00:26:12] "PUT /Vendors/input.cshtml?type=ZState&token=30aea4c737ec HTTP/1.0" 200 -
that log actually looks good.. did you try resyncing your Z?
Powered off and powered back on using the hardware switch...If that's what you mean.
yep - thats what i meant.. can you access the server via a local web browser? it looks like its up (where you see the "running on..."). Maybe try resetting the network on the z (maybe its using something cached)?
Yes, I can access it from the web browser.
I've been using the USB Ethernet adapter since day one because of problems like this. it didn't work on WiFi I tried on WiFi now and it gives the same error.
@Rudder2 - are you trying to resume a session or anything w/ your z?
No, it worked fine when I brewed 9 days ago. Powered off after the rinse and today I powered her back on to rack a beer and got that error. I updated the PiServer this morning because I noticed there was a couple commits since last update.
Deleted the error above (ran locally w/ just your input string - there's a bunch of other data thats hidden). I just pulled the latest code and ran off my Pi 0W wirelessly, it sync'd everything fine.. Try rebooting your Z again? 🤷♂️
This has boiler mismatch written all over it 🤣
Still having the problem...
@Rudder2 looks like your logs are not complete (copy/paste issue?)
-
Feb 13 23:51:34 raspberrypi rc.local[272]: [2021-02-13 23:51:33,999] ERROR in session_parser: An exception occurred parsing session file /picobrew_pico/app/sessions/brew/archive/20210115_174143#30aea4c737ec#02a
Feb 13 23:51:34 raspberrypi rc.local[272]: [2021-02-13 23:51:34,011] ERROR in session_parser: Expecting value: line 2 column 1 (char 1)
Specifically here the session file name isn't long enough and looks like your terminal width cut off the rest of the output.
Archive session files shouldn't impact the Z logic, but to test you can backup and delete this file since it is empty anyways.
How many recipes do you have by chance?
I deleted the file as it only had a ] in it. That fixed the server log. But i still get the Error Net HTTP 0 after that. That log is all i got on the SSH terminal screen. The error is gone in log. Only my Z can't connect.
Number of recipes haven't changed since last brew session. Just finished the last brew of HopHeads IPA#1-3 last week so haven't added new recipes yet. I was able too use the the Z with current recipes count, 2...
@Rudder2 how many recipes do you have for the Z? More than 20? If so delete/back up some as there is a limit to what the Z can "pull" at a given point in time.
A view of the recipes that you have would be helpful, sometimes specific characters in the recipe name or step name will also break the expected protocol (not sure which specifically so this ATM).
From the logs sent so far there isn't a error reported by the ZState request so has to do with what that is responding with. If you can curl
with that URI (shown in the logs) and show the response that could be helpful too
There are only 2 Recipes on the server. They have been on the server for 3 or 4 weeks without issue since you fixed the naming a few weeks ago.
pi@raspberrypi:~ $ curl http://0.0.0.0:8080 <!DOCTYPE html>
Sorry I should have been clearer here.
Please post the results of this request.
curl -X PUT "/Vendors/input.cshtml? type=ZState&token=30aea4c737ec"
This is the request the Z makes at startup and is the only request I can see in the logs you have posted this far that have reference to your Z's boot up sequence.
Now that I think about it my Z needs a clean. Could this be because of the Clean logic?
pi@raspberrypi:~
$ curl -X PUT "http://0.0.0.0:8080/Vendors/input.cshtml? type=ZState&token=30aea4c737ec"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
Error code: 400
Message: Bad request syntax ('PUT /Vendors/input.cshtml? type=ZState&token=30aea4c737ec HTTP/1.1').
Error code explanation: HTTPStatus.BAD_REQUEST - Bad request syntax or unsupported method.
`
pi@raspberrypi:~ $ curl -X PUT "127.0.0.1/Vendors/input.cshtml? type=ZState&token=30aea4c737ec" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
Error code: 400
Message: Bad request syntax ('PUT /Vendors/input.cshtml? type=ZState&token=30aea4c737ec HTTP/1.0').
Error code explanation: HTTPStatus.BAD_REQUEST - Bad request syntax or unsupported method.
Seeing the output of that request would be helpful to debug further. I've tested with the Z clean (prior to the latest fix of detecting file name formats), but could be related.
@Rudder2 of sorry my copy/paste had a space between ? type=
which won't be parsed right.
curl -X PUT "/Vendors/input.cshtml?type=ZState&token=30aea4c737ec"
pi@raspberrypi:~ $ curl -X PUT "127.0.0.1/Vendors/input.cshtml?type=ZState&token=30aea4c737ec" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
Anything show up in the logs for that?
But I'm confused cause when your machine hits this endpoint the logs show it successful.
Feb 13 23:51:36 raspberrypi rc.local[272]: 127.0.0.1 - - [13/Feb/2021 23:51:36] "PUT /Vendors/input.cshtml?type=ZState&token=30aea4c737ec HTTP/1.0" 200 -
pi@raspberrypi:~ $ systemctl status rc.local ● rc-local.service - /etc/rc.local Compatibility Loaded: loaded (/lib/systemd/system/rc-local.service; enabled-runtime; vendor preset: enabled) Drop-In: /usr/lib/systemd/system/rc-local.service.d └─debian.conf /etc/systemd/system/rc-local.service.d └─ttyoutput.conf Active: active (running) since Mon 2021-02-15 19:09:47 EST; 13h ago Docs: man:systemd-rc-local-generator(8) Process: 270 ExecStart=/etc/rc.local start (code=exited, status=0/SUCCESS) Tasks: 3 (limit: 881) CGroup: /system.slice/rc-local.service └─383 python3 server.py 0.0.0.0 8080
Feb 16 08:49:10 raspberrypi rc.local[270]: File "/picobrew_pico/app/main/routes_zseries_api.py", line 113, in process_zseries_put_request Feb 16 08:49:10 raspberrypi rc.local[270]: if type == 'ZState' and request.json['CurrentFirmware']: Feb 16 08:49:10 raspberrypi rc.local[270]: TypeError: 'NoneType' object is not subscriptable Feb 16 08:49:10 raspberrypi rc.local[270]: 127.0.0.1 - - [16/Feb/2021 08:49:10] "PUT /Vendors/input.cshtml?type=ZState&token=30aea4c737ec HTTP/1.1" 500 - Feb 16 08:49:12 raspberrypi rc.local[270]: 127.0.0.1 - - [16/Feb/2021 08:49:12] "POST /socket.io/?EIO=3&transport=polling&t=NUh6X_q&sid=0a651f1593064169ac491a66b9b5dc8c HTTP/1.1" 200 - Feb 16 08:49:12 raspberrypi rc.local[270]: 127.0.0.1 - - [16/Feb/2021 08:49:12] "GET /socket.io/?EIO=3&transport=polling&t=NUh6Rgo&sid=0a651f1593064169ac491a66b9b5dc8c HTTP/1.1" 200 - Feb 16 08:49:38 raspberrypi rc.local[270]: 127.0.0.1 - - [16/Feb/2021 08:49:38] "POST /socket.io/?EIO=3&transport=polling&t=NUh6eM4&sid=0a651f1593064169ac491a66b9b5dc8c HTTP/1.1" 200 - Feb 16 08:49:38 raspberrypi rc.local[270]: 127.0.0.1 - - [16/Feb/2021 08:49:38] "GET /socket.io/?EIO=3&transport=polling&t=NUh6Y10&sid=0a651f1593064169ac491a66b9b5dc8c HTTP/1.1" 200 - Feb 16 08:50:04 raspberrypi rc.local[270]: 127.0.0.1 - - [16/Feb/2021 08:50:04] "POST /socket.io/?EIO=3&transport=polling&t=NUh6kiK&sid=0a651f1593064169ac491a66b9b5dc8c HTTP/1.1" 200 - Feb 16 08:50:04 raspberrypi rc.local[270]: 127.0.0.1 - - [16/Feb/2021 08:50:04] "GET /socket.io/?EIO=3&transport=polling&t=NUh6eNK&sid=0a651f1593064169ac491a66b9b5dc8c HTTP/1.1" 200 -
Oh right... Forgot that with the Z there is a whole request payload as well... darn inconsistency in PB APIs 🤬! Z's upon state request always have sent the firmware version to check if there are newer versions to pull
This should be successful
curl --header "Content-Type: application/json" \
--request PUT \
--data '{"CurrentFirmware":"0.0.116","BoilerType":1}' \
"/Vendors/input.cshtml?type=ZState&token=30aea4c737ec"
pi@raspberrypi:~ $ curl --header "Content-Type: application/json" --request PUT --data '{"CurrentFirmware":"0.0.116","BoilerType":1}' "127.0.0.1/Vendors/input.cshtml?type=ZState&token=30aea4c737ec" {"Alias":"Rudder2-PicoZ","BoilerType":1,"IsRegistered":true,"IsUpdated":true,"ProgramUri":null,"RegistrationToken":-1,"SessionStats":{"DirtySessionsSinceClean":3,"LastSessionType":0,"ResumableSessionID":-1},"UpdateAddress":"-1","UpdateToFirmware":null,"ZBackendError":0}
To put the theory of mismatched boiler to bed could you go into service.menu (hold click wheel during bootup) and somewhere in there is a "detect boiler type".
While in this menu, only do and select exactly as instructed
- Select Settings>Configure Boiler Ignore the warning that says Do no proceed unless at factory
- Select Boiler Detect You should see a screen that says: Boiler type: Small, or Boiler type: Large
- Confirm the detected boiler type
- Restart the machine
From the API perspective that response looks completely valid to me... And yes indicates a clean is required due to the Z firmware having a DirtySessionsSinceClean
check of >= 3
I've done this 4 times already. This is my go to fix of machine problems.
Any more ideas? Really need to get this back up. I really liked my S but this Z is being a pita. It's hard wired to the PiServer with the USB Ethernet adapter I had to purchase to get it working when I first got the machine. When it works it's great.
I can't reliably log on to SSH either. It works sometimes and sometimes it doesn't. It's like the PiServer freezes but I can't verify that.
I keep getting stuck here when trying to SSH in now: rudder2@Rudder2-BookPC-Ubuntu:~$ ssh pi@192.168.72.1 pi@192.168.72.1's password: Linux raspberrypi 5.4.72+ #1356 Thu Oct 22 13:56:00 BST 2020 armv6l
The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Tue Feb 16 10:10:57 2021 from 192.168.72.196
Never getting a Bash prompt.
How to I see what the Z is telling the server? Is there a command for that?
Figured this out. My computer is connected to both networks and it for some reason has trouble communicating to the PiServer because of the Main Network being connected at the same time. Don't know why this...Probably a routing issue in my OS.
I can't reliably log on to SSH either. It works sometimes and sometimes it doesn't. It's like the PiServer freezes but I can't verify that.
I keep getting stuck here when trying to SSH in now: rudder2@Rudder2-BookPC-Ubuntu:~$ ssh pi@192.168.72.1 pi@192.168.72.1's password: Linux raspberrypi 5.4.72+ #1356 Thu Oct 22 13:56:00 BST 2020 armv6l
The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Tue Feb 16 10:10:57 2021 from 192.168.72.196
Never getting a Bash prompt.
Should i factor reset my Z?
How to I see what the Z is telling the server? Is there a command for that?
Nope unless you have additional logging enabled somewhere in your network. Say my main dev setup is to have mitmproxy in-between my PB devices and the Pi, but I don't expect all users to have that.
Figured this out.
So you up and running or still have problems?
Should i factor reset my Z?
You can always try to do that if you feel it might help, but short of a partial or failed custom firmware update this is not something I would envision helping you.
No, in not up and running. Didn't know what to do so was waiting for more ideas. I'm perplexed by this. I haven't connected to to anything but the PiServer since my first brew. Why would I power it up a week later and it just not work.
Guess I can try connecting to PicoBrew and seeing what it says but that's a pita because it doesn't connect to WiFi that well and my switch is 40 feet from my Z.
On Tue, Feb 16, 2021, 11:31 Trevor Mack notifications@github.com wrote:
Should i factor reset my Z?
You can always try to do that if you feel it might help, but short of a partial or failed custom firmware update this is not something I would envision helping you.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/chiefwigms/picobrew_pico/issues/255#issuecomment-779997739, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKLZHFV7QATKIEAVK2SGVCDS7KTY7ANCNFSM4XS3IUWA .
I do have to reset the Boiler Type if I don't power it on one every 4 or 5 days. That's my reasoning for Factory Resetting...Maybe this machine forgot something important.
Have you heard of the Pi program tcpdump? I read it can do what wireshark can from the Pi terminal.
Do you think the MicroUSB Ethernet failed? The lights are on so I wouldn't think so.
Figured this out.
So you up and running or still have problems?
I was saying I figured out why I would loose connection to the PiServer from my desktop.
It connects to the "Mothership" just fine. Just plugged it in...When I switch back to the PiServer it gives the Error Net HTTP 0.
If you believe there is some changes to the Pi that could be the problem point (my brewery is all boxed up as I'm doing renovations) you can use git
to reset to a version from a couple weeks ago and test again?
I didn't know i could do that or i would of tried that already. How do i use git to downgrade?
Odd - so I hardcoded my server return to match yours (short of the token).. looks like the Z has trouble handling cleans? My firmware is 0.0.116 & BoilerType 0.
I'll get a Error Net HTTP 0 error, reboot, then it says I need to clean. If I hit back, half the times it'll give the same error, half the times it'll display I need a clean. Server responds with the same response regardless if there's an error on the Z or not.
{'Alias': 'ZSeries', 'BoilerType': 0, 'IsRegistered': True, 'IsUpdated': True, 'ProgramUri': None, 'RegistrationToken': -1, 'SessionStats': {'DirtySessionsSinceClean': 3, 'LastSessionType': 0, 'ResumableSessionID': -1}, 'UpdateAddress': '-1', 'UpdateToFirmware': None, 'ZBackendError': 0}
As a temp hack, you could try to edit picobrew_pico/app/main/routes_zseries_api.py
, line 185, and set it to be "DirtySessionsSinceClean": 0,
- this will make your repo modified, and on subsequent updates, may conflict...
Running the following would also revert the clean commit.
git reset --hard 3a25f6e862f1d7a8a94882f8143caad295f3ac5b
Will revert to the commit right before the clean addition. Give that a try.
Weird that the clean response gives a periodic error... Once I get my brewery back setup I'll have to debug some more.
Though I'm still confused why sometimes an error is displayed, especially when on Ethernet.
Or you can manually add a clean session (copy a prior one and change date to today) which will reset the dirty session counter. Any nginx errors?
I really like your PiServer if you can't tell since I haven't used the "Mothership" since I started using it. Today, I decided to update the PiServer and now my PicoZ will only give me the Error HTTP Net 0. The PicoFerms seam to still work. My Piso S in on a shelf right now till I receive my PicoFree kit so I haven't tried it.
My systemctl status rc.local log: pi@raspberrypi:~ $ systemctl status rc.local ● rc-local.service - /etc/rc.local Compatibility Loaded: loaded (/lib/systemd/system/rc-local.service; enabled-runtime; vendor preset: enabled) Drop-In: /usr/lib/systemd/system/rc-local.service.d └─debian.conf /etc/systemd/system/rc-local.service.d └─ttyoutput.conf Active: active (running) since Sat 2021-02-13 23:39:21 EST; 13min ago Docs: man:systemd-rc-local-generator(8) Process: 272 ExecStart=/etc/rc.local start (code=exited, status=0/SUCCESS) Tasks: 3 (limit: 881) CGroup: /system.slice/rc-local.service └─370 python3 server.py 0.0.0.0 8080
Feb 13 23:51:30 raspberrypi rc.local[272]: [2021-02-13 23:51:30,191] ERROR in session_parser: Expecting value: line 2 column 1 (char 1) Feb 13 23:51:32 raspberrypi rc.local[272]: 127.0.0.1 - - [13/Feb/2021 23:51:32] "POST /socket.io/?EIO=3&transport=polling&t=NUUuIbE&sid=a2d3ba04617349b18718de43cebf0707 HTTP/1.1" 200 - Feb 13 23:51:32 raspberrypi rc.local[272]: 127.0.0.1 - - [13/Feb/2021 23:51:32] "GET /socket.io/?EIO=3&transport=polling&t=NUUuCUc&sid=a2d3ba04617349b18718de43cebf0707 HTTP/1.1" 200 - Feb 13 23:51:34 raspberrypi rc.local[272]: [2021-02-13 23:51:33,999] ERROR in session_parser: An exception occurred parsing session file /picobrew_pico/app/sessions/brew/archive/20210115_174143#30aea4c737ec#02a Feb 13 23:51:34 raspberrypi rc.local[272]: [2021-02-13 23:51:34,011] ERROR in session_parser: Expecting value: line 2 column 1 (char 1) Feb 13 23:51:36 raspberrypi rc.local[272]: 127.0.0.1 - - [13/Feb/2021 23:51:36] "PUT /Vendors/input.cshtml?type=ZState&token=30aea4c737ec HTTP/1.0" 200 - Feb 13 23:51:57 raspberrypi rc.local[272]: 127.0.0.1 - - [13/Feb/2021 23:51:57] "GET /socket.io/?EIO=3&transport=polling&t=NUUuIeK&sid=a2d3ba04617349b18718de43cebf0707 HTTP/1.1" 200 - Feb 13 23:51:57 raspberrypi rc.local[272]: 127.0.0.1 - - [13/Feb/2021 23:51:57] "POST /socket.io/?EIO=3&transport=polling&t=NUUuOky&sid=a2d3ba04617349b18718de43cebf0707 HTTP/1.1" 200 - Feb 13 23:52:22 raspberrypi rc.local[272]: 127.0.0.1 - - [13/Feb/2021 23:52:22] "POST /socket.io/?EIO=3&transport=polling&t=NUUuUse&sid=a2d3ba04617349b18718de43cebf0707 HTTP/1.1" 200 - Feb 13 23:52:22 raspberrypi rc.local[272]: 127.0.0.1 - - [13/Feb/2021 23:52:22] "GET /socket.io/?EIO=3&transport=polling&t=NUUuOm0&sid=a2d3ba04617349b18718de43cebf0707 HTTP/1.1" 200 - ...skipping... ● rc-local.service - /etc/rc.local Compatibility Loaded: loaded (/lib/systemd/system/rc-local.service; enabled-runtime; vendor preset: enabled) Drop-In: /usr/lib/systemd/system/rc-local.service.d └─debian.conf /etc/systemd/system/rc-local.service.d └─ttyoutput.conf Active: active (running) since Sat 2021-02-13 23:39:21 EST; 13min ago Docs: man:systemd-rc-local-generator(8) Process: 272 ExecStart=/etc/rc.local start (code=exited, status=0/SUCCESS) Tasks: 3 (limit: 881) CGroup: /system.slice/rc-local.service └─370 python3 server.py 0.0.0.0 8080
Feb 13 23:51:30 raspberrypi rc.local[272]: [2021-02-13 23:51:30,191] ERROR in session_parser: Expecting value: line 2 column 1 (char 1) Feb 13 23:51:32 raspberrypi rc.local[272]: 127.0.0.1 - - [13/Feb/2021 23:51:32] "POST /socket.io/?EIO=3&transport=polling&t=NUUuIbE&sid=a2d3ba04617349b18718de43cebf0707 HTTP/1.1" 200 - Feb 13 23:51:32 raspberrypi rc.local[272]: 127.0.0.1 - - [13/Feb/2021 23:51:32] "GET /socket.io/?EIO=3&transport=polling&t=NUUuCUc&sid=a2d3ba04617349b18718de43cebf0707 HTTP/1.1" 200 - Feb 13 23:51:34 raspberrypi rc.local[272]: [2021-02-13 23:51:33,999] ERROR in session_parser: An exception occurred parsing session file /picobrew_pico/app/sessions/brew/archive/20210115_174143#30aea4c737ec#02a Feb 13 23:51:34 raspberrypi rc.local[272]: [2021-02-13 23:51:34,011] ERROR in session_parser: Expecting value: line 2 column 1 (char 1) Feb 13 23:51:36 raspberrypi rc.local[272]: 127.0.0.1 - - [13/Feb/2021 23:51:36] "PUT /Vendors/input.cshtml?type=ZState&token=30aea4c737ec HTTP/1.0" 200 - Feb 13 23:51:57 raspberrypi rc.local[272]: 127.0.0.1 - - [13/Feb/2021 23:51:57] "GET /socket.io/?EIO=3&transport=polling&t=NUUuIeK&sid=a2d3ba04617349b18718de43cebf0707 HTTP/1.1" 200 - Feb 13 23:51:57 raspberrypi rc.local[272]: 127.0.0.1 - - [13/Feb/2021 23:51:57] "POST /socket.io/?EIO=3&transport=polling&t=NUUuOky&sid=a2d3ba04617349b18718de43cebf0707 HTTP/1.1" 200 - Feb 13 23:52:22 raspberrypi rc.local[272]: 127.0.0.1 - - [13/Feb/2021 23:52:22] "POST /socket.io/?EIO=3&transport=polling&t=NUUuUse&sid=a2d3ba04617349b18718de43cebf0707 HTTP/1.1" 200 - Feb 13 23:52:22 raspberrypi rc.local[272]: 127.0.0.1 - - [13/Feb/2021 23:52:22] "GET /socket.io/?EIO=3&transport=polling&t=NUUuOm0&sid=a2d3ba04617349b18718de43cebf0707 HTTP/1.1" 200 -