Go to advanced search

by DougieLawson
Sun Feb 25, 2018 8:55 pm
Forum: Python
Topic: [Python3] Parsing Json with json
Replies: 2
Views: 31

Re: [Python3] Parsing Json with json

#!/usr/bin/python json_s = '{"client1":{"percent":56},"client2":{"percent":53},"client3":{"percent":23},"client4":{"percent":60},"client5":{"percent":9}}' import json json_p = json.loads(json_s) for key1, val in json_p.iteritems(): print key1 for key2 in val: print key2, val[key2]
by DougieLawson
Sun Feb 25, 2018 4:30 pm
Forum: General discussion
Topic: mosquitto and loraserver not connecting
Replies: 1
Views: 53

Re: mosquitto and loraserver not connecting

What's in /etc/mosquitto/mosquitto.conf it should have # Place your local configuration in /etc/mosquitto/conf.d/ # # A full description of the configuration file is at # /usr/share/doc/mosquitto/examples/mosquitto.conf.example pid_file /var/run/mosquitto.pid persistence true persistence_location /v...
by DougieLawson
Sun Feb 25, 2018 12:35 pm
Forum: Camera board
Topic: Pi3 and Camera V2
Replies: 3
Views: 61

Re: Pi3 and Camera V2

You're directing the output from raspivid to stdout not to your video file.

Change -o - > /home/pi/Videos/my_file.h264 to -o /home/pi/my_file.h264

See https://www.raspberrypi.org/documentati ... aspivid.md
by DougieLawson
Sun Feb 25, 2018 11:14 am
Forum: Beginners
Topic: Can I connect Raspberry pi and Arduino wirelessly?
Replies: 10
Views: 188

Re: Can I connect Raspberry pi and Arduino wirelessly?

Connect your Raspberry to your network, connect your ESP8266 to your network.
by DougieLawson
Sun Feb 25, 2018 10:48 am
Forum: Beginners
Topic: Can I connect Raspberry pi and Arduino wirelessly?
Replies: 10
Views: 188

Re: Can I connect Raspberry pi and Arduino wirelessly?

A Wemos is a ESP8266.
by DougieLawson
Sun Feb 25, 2018 10:06 am
Forum: Beginners
Topic: Can I connect Raspberry pi and Arduino wirelessly?
Replies: 10
Views: 188

Re: Can I connect Raspberry pi and Arduino wirelessly?

It's not easy to make Arduino's wireless as they don't have native WiFi. Switch to a Wemos D1 and it's an order of magnitude easier as the Wemos has WiFi on the board (you have fewer GPIOs on a Wemos and only one analog, but the WiFi makes up for that).
by DougieLawson
Sat Feb 24, 2018 6:38 pm
Forum: Troubleshooting
Topic: daemon/service failure how to troubleshoot.
Replies: 6
Views: 116

Re: daemon/service failure how to troubleshoot.

start with journalctl -xe

Then look at cat /var/log/messages and cat /var/log/syslog
by DougieLawson
Sat Feb 24, 2018 5:58 pm
Forum: Official Foundation Display
Topic: Touch is missing the lower part of the screen
Replies: 10
Views: 304

Re: Touch is missing the lower part of the screen

And then you read the readme on how to use xinput calibrator? I don't know if the sequence number is important, I also have a 10-evdev.conf in the same directory. Maybe the calibration data has to be after that in the sequence. The last time I did much with xorg.conf files they were all 1 file. ......
by DougieLawson
Sat Feb 24, 2018 8:06 am
Forum: Networking and servers
Topic: Install LISTSERV on Raspberry Pi
Replies: 3
Views: 129

Re: Install LISTSERV on Raspberry Pi

Use mailman it's ready to install with apt-get.
by DougieLawson
Sat Feb 24, 2018 7:57 am
Forum: Off topic discussion
Topic: Invalid desktop entry file
Replies: 6
Views: 2505

Re: Invalid desktop entry file

If you've found a bug, report it here: https://bugs.freedesktop.org/enter_bug. ... file-utils
by DougieLawson
Fri Feb 23, 2018 5:21 pm
Forum: Networking and servers
Topic: MQTT Broker on Home Network
Replies: 1
Views: 66

Re: MQTT Broker on Home Network

sudo apt install mosquitto mosquitto-client*
by DougieLawson
Fri Feb 23, 2018 1:44 pm
Forum: Beginners
Topic: Raspberry update shell script - error
Replies: 4
Views: 137

Re: Raspberry update shell script - error

The simple answer is remove that rpi-update stuff completely. It isn't needed for anyone other than the folks working the the Raspberry Pi Foundation on the leading edge kernel and firmware development.

Running rpi-update can (and has done with my systems) break your system and leave it not bootable.
by DougieLawson
Fri Feb 23, 2018 12:00 pm
Forum: Raspberry Pi Desktop for PC and Mac
Topic: Upgrade to kernel 4.14?
Replies: 5
Views: 142

Re: Upgrade to kernel 4.14?

Don't ever run rpi-update. It's not needed, it installs untested, experimental kernels and bootcode. If you can't repair an unbootable system in 20 minutes rather than 20 hours the rpi-update isn't for you.
by DougieLawson
Fri Feb 23, 2018 9:23 am
Forum: Beginners
Topic: Can't reach internet
Replies: 1
Views: 52

Re: Can't reach internet

Get the results from the following commands

ip addr show
ip route
ping -c3 $(ip route | awk '/default/ {print $3}')
ping -c3 8.8.8.8
ping -c3 google.com
cat /etc/resolv.conf


DO NOT blank out any of the results; those commands do not reveal any sensitive information.
by DougieLawson
Fri Feb 23, 2018 7:04 am
Forum: Automation, sensing and robotics
Topic: Pi to Pi communication over Local network
Replies: 2
Views: 54

Re: Pi to Pi communication over Local network

Code: Select all

os.system('modprobe w1-gpio')
os.system('modprobe w1-therm')
Remove those two lines.

Add

Code: Select all

dtoverlay=w1-gpio
to your /boot/config.txt file and reboot.
by DougieLawson
Fri Feb 23, 2018 6:40 am
Forum: General discussion
Topic: Pi 4 wish list.
Replies: 11
Views: 517

Re: Pi 4 wish list.

I would like the Pi 4 to include wheels. And a sandwich. Would your wheels and sandwiches work with the pink ponies and unicorns? I can see an interfacing problem. My guess! A Pi 3A+W The Pi3A exists. It just hasn't been released, for...reasons. Where's you evidence? There's no such thing as a Pi3A...
by DougieLawson
Thu Feb 22, 2018 10:50 pm
Forum: Weather station
Topic: It stopped uploading to Oracle
Replies: 4
Views: 190

Re: It stopped uploading to Oracle

Make the change to your crontab to include

Code: Select all

>> /home/pi/weather.log
on the end of the command.
by DougieLawson
Thu Feb 22, 2018 12:21 am
Forum: Beginners
Topic: Just got my pi, stumped on something
Replies: 2
Views: 166

Re: Just got my pi, stumped on something

sudo apt install python{,3}-mysql.connector
Job done.

https://dev.mysql.com/doc/connector-python/en/ tells you how to use it.
by DougieLawson
Wed Feb 21, 2018 6:09 am
Forum: Automation, sensing and robotics
Topic: Pi to Pi communication over Local network
Replies: 5
Views: 568

Re: Pi to Pi communication over Local network

lamaan wrote:
Tue Oct 31, 2017 4:10 pm
... want to achieve is that I want to send commands from one pi and recieve it on the other pi and also send some data of sensor readings from one Pi to another.
Take a look at MQTT with HiveMQ, Mosquitto or RabbitMQ
by DougieLawson
Wed Feb 21, 2018 5:55 am
Forum: General discussion
Topic: Snap7
Replies: 1
Views: 130

Re: Snap7

Are you using python2 or python3?

Use sudo pip ... to install for python2, use sudo pip3 ... to install for python3.
by DougieLawson
Wed Feb 21, 2018 5:37 am
Forum: Off topic discussion
Topic: Recommendations for a good, but cheap, multimeter
Replies: 26
Views: 3312

Re: Recommendations for a good, but cheap, multimeter

cesttonal wrote:
Tue Feb 20, 2018 5:37 pm
if anyone has used Mastech MS8268.
I'll let you know some time after early April. I've been meaning to upgrade from my own analog meter and that looks like the one my wife can get for my birthday.
by DougieLawson
Wed Feb 21, 2018 5:24 am
Forum: Weather station
Topic: It stopped uploading to Oracle
Replies: 4
Views: 190

Re: It stopped uploading to Oracle

Change your crontab entries to

Code: Select all

/home/pi
from

Code: Select all

~
so that you can be sure cron can find the programs.

Add some logging change

Code: Select all

weather-station/upload_to_oracle.py
to

Code: Select all

weather-station/upload_to_oracle.py >> /home/pi/oracle.log
by DougieLawson
Mon Feb 19, 2018 10:23 pm
Forum: Advanced users
Topic: Help Making a Clock
Replies: 3
Views: 268

Re: Help Making a Clock

Here's a python program that calculates sunrise/sunset import ephem from numpy import pi from datetime import date, time, datetime def time_string(et): et = et.tuple() d = date(et[0], et[1], et[2]) t = time(et[3], et[4], int(et[5])) dt = datetime.combine(d, t) return dt.strftime("%d %b %Y %H:%M:%S U...
by DougieLawson
Mon Feb 19, 2018 10:16 pm
Forum: Advanced users
Topic: What's the best way for setting up a server?
Replies: 3
Views: 185

Re: What's the best way for setting up a server?

Wemos D1 can do MQTT subscriptions and publishing with https://pubsubclient.knolleary.net
by DougieLawson
Mon Feb 19, 2018 9:45 pm
Forum: Off topic discussion
Topic: RPi4
Replies: 20
Views: 808

Re: RPi4

You do realise that anyone who knows about any future product would be gagged with a non-disclosure agreement. Therefore, as always, these "wish list" pink ponies and unicorn threads are entirely pointless and will never get details about "RPi Next", RPi4, RPi5, RPi73 or RPi99999999.

Go to advanced search