Go to advanced search

by netromaster
Mon Jun 11, 2018 8:40 pm
Forum: Python
Topic: Conditional statement fails to initialize sound file
Replies: 4
Views: 507

Re: Mqtt script fails to initialize mp3 file with SoX and aplay

I imported mqtt and all the required libraries. About the indentation problem, do i indent to the left of right?
by netromaster
Mon Jun 11, 2018 7:24 pm
Forum: Python
Topic: Conditional statement fails to initialize sound file
Replies: 4
Views: 507

Conditional statement fails to initialize sound file

I have a python script that listens for incoming payloads and should act according to the publication from the client. When the topic is published to it should play an mp3 file using SoX, os.system('play --no-show-progress %s --channels 2 synth %s' % (sound1, duration)) but it doesn't. I figured tha...
by netromaster
Tue May 22, 2018 9:51 am
Forum: Python
Topic: How to subscribe to Multiple MQTT topics [solved]
Replies: 7
Views: 5688

Re: SOLVED- How to subscribe to Multiple MQTT topics

duration = 5 # second sound1 = "<path>.mp3" sound2 = "<path>.mp3" sound3 = "<path>.mp3" sound4 = "<path>.mp3" sound5 = "<path>.mp3" mqtt_topics = ["motion", "abc", "def", "ghi"] # Change to multiple topics that suits your needs. mqtt_broker_ip = "xxx.xxx.xxx.xxx" client = mqtt.Client() # These func...
by netromaster
Sat May 19, 2018 5:15 am
Forum: Python
Topic: How to subscribe to Multiple MQTT topics [solved]
Replies: 7
Views: 5688

Re: Subscribing to Multiple MQTT topics

If I could write some code to do that, I would have already. Like I said, I'm still a noob.
by netromaster
Fri May 18, 2018 9:03 pm
Forum: Python
Topic: How to subscribe to Multiple MQTT topics [solved]
Replies: 7
Views: 5688

Re: Subscribing to Multiple MQTT topics

Your script only subscribes to a single topic, tamper. If you publish an mqtt message to the tamper topic does your script print the progress message beginning "Topic: " ? Does it play the designated sound file? I have only been able to test it with the "button" topic and yes it prints the topic an...
by netromaster
Fri May 18, 2018 8:36 pm
Forum: Python
Topic: How to subscribe to Multiple MQTT topics [solved]
Replies: 7
Views: 5688

How to subscribe to Multiple MQTT topics [solved]

]Hi all, i have a simple enough mqtt script that subscribes to 5 different topics and is supposed to play an alert sound when a topic is published to. However, the script does not check each message to see the topic and message. What i mean is that i want the script to check each message , and do so...
by netromaster
Sun May 13, 2018 5:05 pm
Forum: Python
Topic: Send mqtt payload with paho
Replies: 1
Views: 304

Send mqtt payload with paho

I have this little code below that works well for me, recently i learned about mqtt but i have no idea how to make the code send out mqtt messages when motion is detected. from subprocess import Popen import RPi.GPIO as GPIO import time import paho.mqtt.client as mqtt import os import sys import sub...
by netromaster
Sun May 13, 2018 4:55 pm
Forum: General discussion
Topic: SOLVED- Stretch compiling Opencv3.3.0 stops at 64%
Replies: 1
Views: 180

Re: SOLVED- Stretch compiling Opencv3.3.0 stops at 64%

For the lurkers.
I solved this problem by downloading opencv-3.4.0 and it's contrib packages, compiled with

Code: Select all

make -j4
. Whole process took ~2 hours.
by netromaster
Sun May 13, 2018 4:49 pm
Forum: For sale
Topic: World’s first and smallest Pi 3B+ Poe Hat
Replies: 26
Views: 10246

Re: World’s first and smallest Pi 3B+ Poe Hat

bensimmo wrote:
Thu May 10, 2018 9:34 am
Swaziland should now be called eSwatini, the King changed the name of the country last month.
Thanks for that little bit of information. I never would have known that.
by netromaster
Sun May 06, 2018 4:14 pm
Forum: General discussion
Topic: SOLVED- Stretch compiling Opencv3.3.0 stops at 64%
Replies: 1
Views: 180

SOLVED- Stretch compiling Opencv3.3.0 stops at 64%

I'm compiling opencv 3.3.0 for my pi 3b. At first i ran make without using extra cores, It compiled smoothly but slowly until 58% then stops. Looking for a solution, I find another SOLVED thread that suggested increasing my swapfile size to 1024. I applied that and did make -j4, it continues from 58...
by netromaster
Tue Mar 27, 2018 7:58 pm
Forum: Automation, sensing and robotics
Topic: 12v versus 5v for solar powered circuit.
Replies: 2
Views: 363

12v versus 5v for solar powered circuit.

Greetings Anons, from third world startup. I need expert advice on finishing my circuit board. I have designed it such that it needs 5v and 4 ahmps to function. The project will not be making use of mains power supply but will strictly draw power from batteries. I need to squeeze every drop of effec...
by netromaster
Mon Feb 19, 2018 7:20 pm
Forum: Python
Topic: Infinite loop malfunction
Replies: 15
Views: 1281

Re: Infinite loop malfunction

Due to contact bounce a pushbutton might not produce one event when pressed/released, it is easily possible it produced a very rapid stream of 15 "open/close events", that is normal, and must be resolved with either hardware, or software to remove the contact bounce. I imported a debouncer in the s...
by netromaster
Mon Feb 19, 2018 2:10 pm
Forum: Python
Topic: Infinite loop malfunction
Replies: 15
Views: 1281

Re: Infinite loop malfunction

Actually, 'the other side' side is an LDR that spits out its readings every millisecond and when ever a set threshold is exceeded it publishes to the mqtt topic. I noticed that if I kept my palm over the LDR for too long that it publishes to the topic as long as my palm is over the LDR. So yes. It ...
by netromaster
Mon Feb 19, 2018 12:35 pm
Forum: Python
Topic: Infinite loop malfunction
Replies: 15
Views: 1281

Re: Infinite loop malfunction

PeterO wrote:
Mon Feb 19, 2018 11:19 am
OK, I think you need an mqtt expert now ....
PeterO
So in other words you do not see anything wrong with my python script?
by netromaster
Mon Feb 19, 2018 10:49 am
Forum: Python
Topic: Infinite loop malfunction
Replies: 15
Views: 1281

Re: Infinite loop malfunction

Actually, 'the other side' side is an LDR that spits out its readings every millisecond and when ever a set threshold is exceeded it publishes to the mqtt topic. I noticed that if I kept my palm over the LDR for too long that it publishes to the topic as long as my palm is over the LDR. So yes. It p...
by netromaster
Mon Feb 19, 2018 9:40 am
Forum: Python
Topic: Infinite loop malfunction
Replies: 15
Views: 1281

Re: Infinite loop malfunction

PeterO wrote:
Mon Feb 19, 2018 8:40 am
Is it just the sound that repeats, or does the "Topic" message get printed multiple times as well ?

PeterO
Topic message gets printed multiple times as well.
by netromaster
Mon Feb 19, 2018 1:13 am
Forum: Python
Topic: Infinite loop malfunction
Replies: 15
Views: 1281

Infinite loop malfunction

I have python code that acts as an mqtt server to listen for mqtt pubs. It works just fine, except that whenever the topic is published to it will loop the command to play the alert instead of only playing the sound when the topic is published to. Can anyone spot correct the code for me? import paho...
by netromaster
Wed Jan 31, 2018 5:58 am
Forum: Python
Topic: Toggle 1602 lcd backlight on/off
Replies: 12
Views: 2256

Re: Toggle 1602 lcd backlight on/off

I got it working now. Thanks everyone!
Now on to the next.
by netromaster
Tue Jan 30, 2018 6:48 pm
Forum: Python
Topic: Toggle 1602 lcd backlight on/off
Replies: 12
Views: 2256

Re: Toggle 1602 lcd backlight on/off

here's the link http://www.famosastudio.com/i2c-lcd-backpack You can toggle the backlight. The pins are RS == P0 RW == P1 EN == P2 BL == P3 D4 == P4 D5 == P5 D6 == P6 D7 == P7 I think Richard Hull has support in his library at: https://github.com/rm-hull/luma.lcd but I've not checked (both of my PC...
by netromaster
Tue Jan 30, 2018 6:23 pm
Forum: Python
Topic: Toggle 1602 lcd backlight on/off
Replies: 12
Views: 2256

Re: Toggle 1602 lcd backlight on/off

You mean to say where there is a physical jumper the backlight can't be toggled with code?
by netromaster
Tue Jan 30, 2018 4:37 pm
Forum: Python
Topic: Toggle 1602 lcd backlight on/off
Replies: 12
Views: 2256

Re: Toggle 1602 lcd backlight on/off

Yes I'm sure my i2c supports it.
by netromaster
Tue Jan 30, 2018 2:34 pm
Forum: Python
Topic: Toggle 1602 lcd backlight on/off
Replies: 12
Views: 2256

Toggle 1602 lcd backlight on/off

I have a working library for my 1602 char lcd connected to an i2c adapter. In the python code i see that there is a defined constant to turn off/on the lcd. LCD_BACKLIGHT = 0x08 # On #LCD_BACKLIGHT = 0x00 # Off But when i initiate the command to turn lcd off for 5 seconds it doesn't seem to work. lc...
by netromaster
Wed Jan 03, 2018 8:43 pm
Forum: Troubleshooting
Topic: Python scripts not running on boot
Replies: 0
Views: 171

Python scripts not running on boot

I have a number of sensors connected to my pi 3 and i put the python scripts (7 of them) that starts the sensors at boot in the /etc/profile/ folder.. Of the 7 scripts, i noticed that only the scripts that turns on a led and the 16x2 lcd runs at startup no matter where i put the scripts, (be it rc.l...
by netromaster
Wed Jan 03, 2018 8:04 pm
Forum: Troubleshooting
Topic: USB wifi driver installation procedure
Replies: 14
Views: 8148

Re: USB wifi driver installation procedure

okay, i followed the link you provided and for the first time since i got this pi i'm connected via wifi. Thanks for the help guys!

Go to advanced search