Go to advanced search

by OldPCGuy
Mon Dec 16, 2019 6:23 pm
Forum: Python
Topic: Import Issue With Various IDE
Replies: 4
Views: 306

Re: Import Issue With Various IDE

That does clear things up. I'll need to go back and update/set my modules to the same level.

As for Geany I was just using it straight out of the box. I didn't realise it defaulted to a lower version.

Thx!
by OldPCGuy
Sun Dec 15, 2019 7:08 pm
Forum: Python
Topic: Import Issue With Various IDE
Replies: 4
Views: 306

Re: Import Issue With Various IDE

So I was able to get the code working in Python 3.5 adding the MQTT path to sys. import os import time import sys sys.path.append('/usr/local/lib/python2.7/dist-packages/paho_mqtt-1.3.1-py2.7.egg/') import paho.mqtt.client as mqtt import Adafruit_DHT DHT_SENSOR = Adafruit_DHT.DHT22 However I could n...
by OldPCGuy
Sun Dec 15, 2019 4:15 pm
Forum: Python
Topic: Import Issue With Various IDE
Replies: 4
Views: 306

Import Issue With Various IDE

If I use Python 3.5 IDE to run my code I get the following error. Traceback (most recent call last): File "/home/pi/MQTT_WeatherStation/MQTT_DHT22.py", line 6, in <module> import paho.mqtt.client as mqtt ImportError: No module named 'paho' If I run the same code in Geany IDE it works. This is the im...
by OldPCGuy
Sat Nov 16, 2019 7:02 pm
Forum: Python
Topic: At Startup Multiple Script Instance
Replies: 1
Views: 169

At Startup Multiple Script Instance

I tried using systemd service to launch my python script at boot to read a sensor and publish via MQTT to my local network. Could not get it to work. So my fall back was crontab at boot. Always seems to work for me. I was debugging and when I checked to see if my script was running this is what I sa...
by OldPCGuy
Fri Aug 10, 2018 9:12 pm
Forum: Beginners
Topic: Alexa AVS Conectivity
Replies: 0
Views: 182

Alexa AVS Conectivity

I find a lot of examples for Alexa apps with AVS that host Alexa or equivalent on the PI.

Similar to the way Alexa reads & writes my Nest; can I simply have my Alexa Echo communicate with the PI and voice the information through the Echo?

I'm looking for examples/tutorials. :)

Connectivity
by OldPCGuy
Tue Jun 12, 2018 1:18 am
Forum: Troubleshooting
Topic: Win32 Disk Imager 1.0 Error 5:
Replies: 7
Views: 9829

Re: Win32 Disk Imager 1.0 Error 5:

Ah! struggling. Tried a card already loaded with Stretch hoping it would simple overwrite; nope. Formatted with SDFormat, now I get can't create file system. edit: Got it! with SDFormat I skipped Quick erase went to Full (Erase) that didn't work. I had to format FULL (Overwrite) and the SD cloned fi...
by OldPCGuy
Mon Jun 11, 2018 3:40 pm
Forum: Troubleshooting
Topic: Win32 Disk Imager 1.0 Error 5:
Replies: 7
Views: 9829

Re: Win32 Disk Imager 1.0 Error 5:

I initially looked at using the Pi utility. The way the Pi shows my card reader and devices made me nervous. It appeared to list each partition separate, microSD /boot and a separate device for microSD/system or something like that. It did the same thing for the target card because it is already loa...
by OldPCGuy
Sun Jun 10, 2018 10:39 pm
Forum: Troubleshooting
Topic: Win32 Disk Imager 1.0 Error 5:
Replies: 7
Views: 9829

Win32 Disk Imager 1.0 Error 5:

I'm trying to image/clone my SD card to my Win10 PC hard drive for backup. I get this error; "An error occurred when attempting to get a handle on the file. Error 5: Access is denied." I'm running it as admin on a Win10 PC. I've never had issue going the other way using SDFormat and Win32 Disk Image...
by OldPCGuy
Sat Jun 09, 2018 4:08 pm
Forum: Troubleshooting
Topic: Windows10 Messed up Pi Memory Card
Replies: 15
Views: 1459

Re: Windows10 Messed up Pi Memory Card

If it was running headless, how do you know that the desktop environment was working? Not 100% but fairly sure. Before deploying I test and setup through the GUI/Desktop. Headless it only boots to the cmd line and runs the script. As for the windows episode I only cancelled the one pop-up and pulle...
by OldPCGuy
Thu Jun 07, 2018 10:45 pm
Forum: Troubleshooting
Topic: Windows10 Messed up Pi Memory Card
Replies: 15
Views: 1459

Re: Windows10 Messed up Pi Memory Card

Curious why everyone is assuming the card wasn't corrupt PRIOR to being presented to Windows? I'm 99% sure it wasn't. I pulled it from a headless Pi-Zero that was running earlier in the day. I'll know for sure when see the final time/date stamp on the measurement data in the file I was looking for.
by OldPCGuy
Thu Jun 07, 2018 9:18 pm
Forum: Troubleshooting
Topic: Windows10 Messed up Pi Memory Card
Replies: 15
Views: 1459

Re: Windows10 Messed up Pi Memory Card

If you ignore the message all should be fine. You can only access the fat partition, but no harm should be done. I do it all the time. As already mentioned, if you action that message it will mess up the card. That's what I initially though. I ignored the message, I didn't actively initiate anythin...
by OldPCGuy
Wed Jun 06, 2018 11:38 pm
Forum: Troubleshooting
Topic: Windows10 Messed up Pi Memory Card
Replies: 15
Views: 1459

Windows10 Messed up Pi Memory Card

All I did was plug the OS flash card into a card reader attached to a Win 10 machine. I was hoping to simply pull a CSV file off the card. Well the Windows system said there was a read error on the card so I removed it and plugged it back into the Pi. The Pi boots to the command line but will not st...
by OldPCGuy
Tue May 22, 2018 11:15 pm
Forum: Python
Topic: DHT22 temp/humidity sensor often fails to read
Replies: 6
Views: 2776

Re: DHT22 temp/humidity sensor often fails to read

No need to uninstall anything. Just install per the site instructions. What you show looks correct if memory serves me. Here are some links to sites I pulled info on using the PIGPIO. https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=86771 https://www.rototron.info/dht22-tutorial-for-raspberry...
by OldPCGuy
Mon May 21, 2018 11:13 pm
Forum: Python
Topic: DHT22 temp/humidity sensor often fails to read
Replies: 6
Views: 2776

Re: DHT22 temp/humidity sensor often fails to read

For that sensor I use the PIGPIO libraries vs the default gpio. http://abyz.me.uk/rpi/pigpio/download.html I read somewhere someone was seeing missed readings using the gpio over long periods of time and they switched to PIGPIO. I don't know if it was true or not, but I can say I have no issues runn...
by OldPCGuy
Sat May 19, 2018 10:45 pm
Forum: Python
Topic: Crontab Issue with Paho MQTT
Replies: 9
Views: 1667

Re: Crontab Issue with Paho MQTT

python beginner here too, so i could be shooting wide? but how did you install paho? and other resources i think you may need to use pip3 to install for python3 and pip for python2. if you installed it with another tool for the Geany ide that could be the problem? you may need to install pip/pip3 w...
by OldPCGuy
Fri May 18, 2018 12:35 am
Forum: Python
Topic: Crontab Issue with Paho MQTT
Replies: 9
Views: 1667

Re: Crontab Issue with Paho MQTT

So the code runs by does not publish. I assume the try block is doing its thing error handling. Or is it.... I'm not sure the file I think is running is actually running :cry: I confirmed the broker is running via cmd line pub/sub . Digging deeper I notice Geany IDE saves the script *.py.py and *.py...
by OldPCGuy
Thu May 17, 2018 11:24 pm
Forum: Python
Topic: Crontab Issue with Paho MQTT
Replies: 9
Views: 1667

Re: Crontab Issue with Paho MQTT

Doug, I'm new to try/except blocks. If I understand correctly the try: block only handles exception for a failed to connect. The publish statement will always execute after the while block is done, payload just won't go anywhere? client.publish("topic/WtrHtr", str(payload)) Also are 10 attempts made...
by OldPCGuy
Wed May 16, 2018 12:41 am
Forum: Python
Topic: Crontab Issue with Paho MQTT
Replies: 9
Views: 1667

Crontab Issue with Paho MQTT

I have a script that loads at boot from crontab. # start water heater measure @reboot /usr/bin/python /home/pi/Multi_DS18B20.py imports and basic setups are like so; #!/usr/bin/python from DS18B20_Class import DS18B20 # from file X import func Y Modified class from https://www.raspberrypi.org/forums...
by OldPCGuy
Fri May 11, 2018 12:31 am
Forum: Troubleshooting
Topic: Script Behaviour Changes When Headless
Replies: 3
Views: 493

Re: Script Behaviour Changes When Headless

Finally figured this one out, wasn't the code.

I was missing a pull-down resister on pin 17 for the push button input (shutdown button).

:oops:

Odd that with HDMI plugged in it worked; un-plugged it didn't. The input must float around the threshold so the HDMI load pulled it down low enough.
by OldPCGuy
Mon May 07, 2018 11:57 pm
Forum: Troubleshooting
Topic: Script Behaviour Changes When Headless
Replies: 3
Views: 493

Re: Script Behaviour Changes When Headless

Still scratching my head on this one. I tried using/launch using crontab and it still executes the shutdown logic immediately when headless. I figured out that the monitor plugged in or not determines if the scrip runs properly. What could it possibly be? I have a basic OS load. PRETTY_NAME="Raspbia...
by OldPCGuy
Sun Apr 29, 2018 2:09 pm
Forum: Troubleshooting
Topic: Script Behaviour Changes When Headless
Replies: 3
Views: 493

Script Behaviour Changes When Headless

I have a Pi3 that with the keyboard, mouse, and monitor plugged in launches my Python script and runs as expected. When I deploy the same Pi3 headless the script immediately executes some shutdown code. The shut down should only happen if I press and hold a button for three seconds. Why the differen...
by OldPCGuy
Sat Apr 28, 2018 4:24 pm
Forum: General discussion
Topic: Auto running a program after boot
Replies: 41
Views: 40057

Re: Auto running a program after boot

Stupid question...

... to disable running the file after boot do you just delete the *.service file? No other housekeeping required ?
by OldPCGuy
Mon Apr 23, 2018 3:57 pm
Forum: Python
Topic: Power Off Button Interupt
Replies: 1
Views: 316

Power Off Button Interupt

I have a headless PiZero and off button that works with code that loops and polls. I would like to use the interrupt method. The intent is to have the button press first close a CSV file then shutdown the Pi. As a beginner/novice I don't understand where the try: loop shown in the online examples re...
by OldPCGuy
Sun Apr 01, 2018 2:38 pm
Forum: Automation, sensing and robotics
Topic: [GUIDE] Communicate between iOS and Raspberry Pi using MQTT
Replies: 67
Views: 44614

Re: [GUIDE] Communicate between iOS and Raspberry Pi using MQTT

I solved my issue but... why would the Geany IDE resolve/import the paho.mqtt and the IDLE IDE would not? should I have installed paho-mqtt under sudo? I get the following error :( ====================== RESTART: /home/pi/MQTTDemo4.py ======================= Traceback (most recent call last): File "...
by OldPCGuy
Sat Mar 31, 2018 7:38 pm
Forum: General programming discussion
Topic: Mosquito Error:Address already in use
Replies: 37
Views: 21647

Re: Mosquito Error:Address already in use

You've got two copies running. A stock install sets mosquitto up as a systemd service that will start at boot time. I did not realise that. Rather than generate a test Sub and Pub is there a command line Ping_Req to check that the Broker is running? I can't find any syntax examples in my searches.

Go to advanced search