Disable Serial console login via Raspi-Config - select advanced menu
sudo raspi-config
sudo nano /boot/config.txt
change
enable_uart = 0
to
enable_uart = 1
sudo apt-get install minicom
sudo apt-get install python-serial
reboot
Disable Serial console login via Raspi-Config - select advanced menu
sudo raspi-config
sudo nano /boot/config.txt
change
enable_uart = 0
to
enable_uart = 1
sudo apt-get install minicom
sudo apt-get install python-serial
reboot
Win32DiskImager says SD card too small even though I'm trying to write an 8gb image to an 8gb SD card
Use SDImager.exe instead. It will write disk image until it runs out of room on the SD card. Most Linux images have blank (allocated) space at the end of the image so normally the unwritable data is not important.
https://sourceforge.net/projects/sdimager/
Forget Energenie's own sample. See http://bennuttall.com/whats-new-gpio-zero-v1-2/
https://pypi.python.org/pypi/energenie
from energenie import switch_on, switch_off from time import sleep # turn all plug sockets on and off switch_on() switch_off() # turn a plug socket on and off by number switch_on(3) switch_off(3)
sudo apt-get install python-pip
sudo pip install energenie
sudo apt-get install mysql-client python-mysqldb -y
sudo apt-get update
sudo apt-get install samba samba-common-bin
Configure the software
sudo nano /etc/samba/smb.conf
Scroll to bottom of file, add the following
[USBDrive]
comment=USB Drive Share
path=/mnt/usbdrive
browseable=Yes
writeable=Yes
only guest=no
create mask=0777
directory mask=0777
public=yes
[Images]
comment=Images
path=/var/www/html/images
browseable=Yes
writeable=Yes
only guest=no
create mask=0777
directory mask=0777
public=yes
Sometimes I need to set up a Raspberry Pi and configure it to connect to a WIFI network. Sometimes that network is not available at the time. I know the network name and password in advance.
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
network={
scan_ssid=1
ssid= "<wifi name>"
psk="<password>"
}
I've produced version 2.1 of the WeatherPi and now have 4 in long term test. They seem to be doing well. It looks like the MCP23017 chip can't keep up with the wind speed detector, so that's sensor is now going through an arduino nano, and in to the pi via the serial connection. If an Arduino Nano is being used, might as well use it for the analogue sensors as well.
Possible changes to the Weather Pi? Remove 2 x I2C Analogue converters and replace with an Arduino Nano. Add 2 headers dedicated to running servos direct from the pi for Pan and Tilt Camera. Add header for serial I/O. Possibly pre-route some GPIO ports to the breakout section of the board.
On a separate subject I've moved the 433mz receiver from a dedicated Pi to the Weather Display Pi. This seems to be working well.
I've removed the aircraft tracking facility from Pi 7 as I never seemed to actually use the data. I did have it feeding in to the Flight24 website but again they never seemed to use the data.
My test Pi is currently testing PL9823 RGB Addressable LED's which are similar to Neopoxles / WS2811 / WS2812. Testing seems to be going well, although I can only get them displaying Red, Green, Blue, Yellow, Purple, Pink and White. I can't get them to "dither" other colours.
I received a Pi Zero on the front cover of my Magpi Magazine, and at this stage not sure what I'll do with it.
WeatherPi version 2 has been assembled and I have attempted to test. And that's when I hit some issues.
I'd assembled the board with new 40pin extended headers to fit to a A+, B+ or 2. Unfortunately my test Pi was an old style model A, and the 40 pin header get's in the way of the Audio port on the classic A. I tried it on a B+ that I have but the PC can't clear the USB and ethernet socket. Major fail. I'd soldered the extended header too close to the PCB rather than at the full extent.
Thankfully I came up with the idea of using an additional header to "stand off" the PCB from the Pi. This worked but left a 10cm square board hanging in mid air. Once populated with cables the entire thing tips over. Another reason the next version must have mounting holes for both forms of Pi.
Once I'd worked that out I turned on the Pi. I had a power light but nothing happening. I'd already tested the Pi and it was fully networked, but I couldn't connect. I gave in and connected a monitor to find it wasn't booting up.
To cut a very long story short I spent a very annoying two days trying to figure it all out. I discovered that despite spending 2 weeks on the PCB design and checking it for a further 5 days, that I'd wired up the IC chips incorrectly.
On the MCP23017 digital input output IC I'd wired up the i2c and power wrongly. Basically I'd wired up from the bottom upwards, but should have missed a pin at the start which is not used.
On one of the PCF8591 analogue chip I'd missed out an SCL connection for i2c. On both chips I'd mistakenly wired up the address pins to positive instead of negative. This isn't a big issue as the chips appear successfully on different port numbers. I'd also connected the VSS pin to positive instead of negative.At this stage I'm ready to give up.
The WeatherPi version 2 PCB has finally arrived from Seedstudio in Singapore.
I'm impressed with the "customer experience" from Seedstudio and they always seem to delivery 3 weeks after initial order.
10 PCB's came in at about £20. To have these produced in the UK would have cost about £50 for the first one
The PCB was populated in height order. Smallest components first working my way up to the tallest components :-
I've gone ahead and assembled it and these are my initial thoughts:-
Next step will be testing and initial power on!
As part of development of Weather Pi, I wanted to test out Analogue sensors with the Raspberry Pi. I had a look a some of the commercial available PCB's such as Custard Pi and Quick2Wire but was shocked at the high price (£15 - £20 plus P&P).
The PCF8591 I2C chips that these units are based on can be purchased for about £1 so that does not justify the high price. This includes postage from China.
Introducing the Analogue Breakout Version 1.2 PCB.
The PCB uses 2 x PCF8591P i2c chips providing 8 ports for analogue sensors. The chips are hard coded on the PCB to use i2c channel 48 and 4c.
The PCB has a jumper to allow the chips to run at 3.3 volts or 5 volts. At the time of designing I was unsure if it was safe to run the chips at 5v when interfacing with the RaspberryPi. Normally the Pi's only like 3.3 volts.
Also on the PCB are 3 x i2c headers running at 3.3v.
The PCB is compatible with all models of Pi except the compute model. Only the 3.3v, 5v, GND, SDA and SCL pins are used. Using a 5cm board it's not possible to include space for all 40 possible GPIO pins, hence why they run to the edge.
The PCB's were ordered from SeedStudio, and cost about £7 for 10.