|
Post by tschmitt on Sept 30, 2018 12:32:43 GMT -8
My son is working on a school project and has built a SmartPlantPi system. We've been following the instructions in the Assembly and Usage Manual and didn't hit any problems until we got to page 29 where we ran SmartPlantPi.py When that window populated, there seemed to be some issues, especially related to PubHub. See the attached .pdf for screen shots from the SmartPlantPi.py output screen My son's project is due on 10/2, so he was hoping the system would be operational for his presentation. Since we are not programmers, we have just about exhausted our trouble-shooting capabilities. Any help you can give would be greatly appreciated. Thanks! Screenshot - SmartPlantPi Issue.pdf (221.69 KB)
|
|
|
Post by SDL on Sept 30, 2018 14:33:15 GMT -8
Hi tchmuitt,
This a new error that we have not seen before. The quick way to fix this (while we look at this tomorrow), is to comment out the following line (line 372) in smartplantpi.py
pubnub.publish().channel('SmartPlantPi_Data').message(myMessage).async(publish_callback) John texted me and let me know he had talked to you. Put a # in front of this line so the section looks like this:
def publishEventToPubNub():
myMessage = {} myMessage["SmartPlantPi_Last_Event"] = state.Last_Event if (DEBUG): print myMessage
#pubnub.publish().channel('SmartPlantPi_Data').message(myMessage).async(publish_callback)
You can edit the file with nano, if that will help.
nano smartplantpi.py Hope this is a little help!
Best regards, BP
|
|
|
Post by tschmitt on Sept 30, 2018 15:45:41 GMT -8
I was able to use nano to comment out that line of code. The device still does not seem to be working properly, however.
When we run the program, it goes through the start up, showing the sensors present and running through some other info. At the bottom, I’m showing a line with an error...It says:
AttributeError: ‘Publish’ object has no attribute ‘async’
After that, the program stops and returns to the command prompt. I’m assuming it’s supposed to continue running so the watering can occur and so the button and rotary switch can be used as described in the manual.
I hope you can help clear this up for us. Our main goal is to get the system working so watering happens automatically and we can read the on-going values on the display. Once that works, we’ll want to try to get the internet portal working where we can monitor the plant via the web.
Thanks!
|
|
|
Post by tschmitt on Oct 1, 2018 3:02:31 GMT -8
Update: I found another related line to comment out and got the program to work where it would read/report values and let us use the buttons. The pump is still not activating, though.
|
|
|
Post by SDL on Oct 1, 2018 9:25:45 GMT -8
Well, that is progress.
Carefully check your wiring, especially the wire connected into the USB Power Control board. The blue light should come on when the pump is activated.
Are you looking at the debugging display on the terminal? Does it say if the pump is activated?
BP
|
|
|
Post by tschmitt on Oct 1, 2018 11:54:19 GMT -8
The wiring is correct. The pump activated (with light showing on the USB connector) when I run the “testAll.py” program. That leads me to believe there is an error in the SmartPantPi.py code.
|
|
|
Post by tschmitt on Oct 1, 2018 13:54:09 GMT -8
Update (again)...we kept troubleshooting and realized the pump was working. The flow control device seemed to be the issue. Checked it’s connections and re-did tubing and now it works.
If you could help with the pubhub issue and send info on how to get results live to web, we’d be operating at full expectations!
Sorry to be a continuous bother...school project deadlines are the best!
|
|
|
Post by SDL on Oct 3, 2018 9:51:06 GMT -8
It's not a bother at all! Interestingly enough, John Shovic told me today that one of his students is reporting exactly the same error on a linux machine hooked up to a very expensive robot!
BP
|
|
|
Post by tschmitt on Oct 3, 2018 11:58:42 GMT -8
Any idea how to fix it?
|
|
|
Post by SDL on Oct 6, 2018 9:02:46 GMT -8
Not yet. Interestingly enough, we are setting up a new Stretch Image and it doesn't happen then.
BP
|
|