User Info

 
 
Welcome, Guest. Please login or register.
Did you miss your activation email?

MultiRotorUK ShoutBox

Refresh History
  • Bad Raven: Balance lead extensions are pence from China, I bought bulk. I also cut the old balance plugs with lead off and if I get a broken plug body I just solder a new one lead to lead, can extend at the same time.
    Today at 14:17:22
  • Reman: Bajadre, With reference to balance leads, I bought a cheap JST XH crimper, plus a shed load of male/female plugs and pins a while back. It's amazing how many times that lots come in handy. Not just for repairing battery packs, But for things like adding quick release plugs to wiring harnesses so you can do things like pop gimbels on and off camera drones quickly, Or add plugs to the cables of hardwired components so you don't have to desolder them when you need to get them out of the way in a rebuild, And making charging extension leads so you can get the battery right into a Li-Po safe bag and away from the expensive charger. They're well worth adding to the toolbox..... The other day I only spent about 5 minutes hunting for my 4S charging lead before giving up and making a new one. If I didn't have the crimping kit I'd probabbly still be looking. :)
    Today at 14:00:55
  • hoverfly: Not unusual Reman, they just cant be ar$ed to deliversome if they get behind schedule.. Yesterday i had a delivery by Herpies,  got a sms telling me when they were going to deliver, then rang the door bell and knocked. The parcel was intact and damage free.  Not sure what is going on.... :hmm:
    Today at 13:23:11
  • Bad Raven: Where is it broken?
    Today at 13:22:29
  • hoverfly: If you cut them off make sure  you insulate the ends. :smiley:
    Today at 13:18:42
  • Bajadre: Quick question guys is it ok to snip off a broken balance lead and not run it i know i wouldnt be able to balance charge it again but would the pack be ok ? its a 3s 5500mah which the lead got dragged along the floor on sundays bahs :(
    Today at 12:44:55
  • Reman: About an hour ago I had the Yodel tracking system tell me that I wasn't in...... That's f*ckin' news to me !!!!!
    Today at 10:17:20
  • Reman: Like I said, In the past I've had a handful of packs "Go off" at me like fireworks after bad crashes (Usually with RC helis), So it's hard to get that image out of your head while stripping down Li-Po's. :)
    January 21, 2019, 11:22:54
  • shawdreamer: the horror stories will always incite worry when messing about with Lipo's but its the same as everything else when working on electronics alike, alsong as your careful and methodical there's very little to panic about, I regularly recycle 4s's with a single dead cell into usable 3s packs, end of the days its alot more economical, safer and enviro friendly than having to bin them....just a pain that the dead cell is NEVER one of the outer cells so you always end up having to strip a good cell off to get at the bad cell before putting it back afterwards, its like dropping toast, it'll always land buttered side down and inevitably covered in pet fur :angry:
    January 21, 2019, 00:11:16
  • Reman: Just did the one electrical job that still scares me. I dismantled some Lipo's with knacked cells and built usable packs out of the good cells. I've had packs go "VOOOOOOSH" at me in the past so I'm always slightly scared of having bare lipo contacts anywhere near what I'm working on, But all appears to have gone well and one of them is currently doing a charge/discharge cycle to make sure nothings a miss. :)
    January 20, 2019, 22:28:43
  • Reman: My original Dremel Pro made it to 14 years of heavy weekend use (And abuse) before it crocked. Dismantled that but it turned out to be a "Control module" fault, And Dremel made it ni on impossible to get into that without pooching it completely. :(
    January 20, 2019, 22:17:27
  • ched999uk: BR  ::)
    January 16, 2019, 22:26:54
  • Bad Raven: That's a warrnty claim if ever I heard one....
    January 16, 2019, 20:32:55
  • ched999uk: My 28 year old 12v 35w Weller soldering iron failed  :( I didn't fancy forking out £100 for a new one. Stripped it down and found conductor snapped in cable. 10Mins later all back working great. :smiley: ::) I am very happy!!
    January 16, 2019, 17:23:06
  • shawdreamer: "look up there....its a drone!.....and whats this noise?..... no.....no..... it cant be!....NOOOOOOOO.......OOOOOOOOOOOOOPS I DID IT AGAIN, I PLAYED WITH YOUR HEAR....."
    January 10, 2019, 14:17:24
  • shawdreamer: <starts downloading britney spears albums and preping his large frame to carry a PA system>
    January 10, 2019, 14:15:08
  • Bajadre: defo steveo :) we should get loads of drones together up there so how they handle more that one lol
    January 08, 2019, 19:39:07
  • steveo9007: its all a ploy to get who ever has won the contract for geofencing the airport in, i reckon  ::)
    January 08, 2019, 18:38:26
  • Bajadre: more lies hope they prepped the police staement already lol
    January 08, 2019, 18:27:49
  • Bad Raven: Take Offs resumed
    January 08, 2019, 18:24:45

Who's Online

Theme Selection



Forum Default

Permanently

Author Topic: Atomic's adventures with a Pi Zero W  (Read 1956 times)

Offline atomiclama

  • Trade Count: (3)
  • Hero Member
  • *****
  • Posts: 2515
  • Liked: 805
  • Country: gb
  • Uhh! What's that then, Oh! new project.
Atomic's adventures with a Pi Zero W
« on: March 07, 2017, 13:05:37 »
Well got my hands on one of these so I'd thought I write about it a bit, mainly as a reference so I can remember what I have done ::)


12g with camera module.

The main projects I have for it are : -
HD recording.
Did some work on this many moons ago but the pi model A was a bit too big to fit on me quad so binned that idea, now with this tiny zero it might be doable. From what I remember the quality was not that bad.

Flight cam.
Yeah I know about the latency but I'd like to see what it is like to fly with.

OSD.
It is possible to overlay the video output with text and graphics. So lets see what I can do.

First steps are getting the BT to work so I can hook up and do stuff without having to use some crappy keypad.
Get Wifi to hook up to my home network and sync any recordings.
Get camera recording.
« Last Edit: December 08, 2017, 11:21:48 by atomiclama »
Wasdale X, Ow that hurt

Offline atomiclama

  • Trade Count: (3)
  • Hero Member
  • *****
  • Posts: 2515
  • Liked: 805
  • Country: gb
  • Uhh! What's that then, Oh! new project.
Bluetooth config
« Reply #1 on: March 07, 2017, 13:05:55 »
Well getting the BT working was a bit of a pain  :rolleyes:

These are the steps I had to go through

Run the Bluetooth in compat mode and add the serial port service, edit this file

Code: [Select]
pi@raspberrypi:~$ sudo nano /etc/systemd/system/bluetooth.target.wants/bluetooth.service

add / modify the lines

Code: [Select]
ExecStart=/usr/lib/bluetooth/bluetoothd -C
ExecStartPost=/usr/bin/sdptool add SP

set the BT as discoverable and some other stuff once I recall

Code: [Select]
pi@raspberrypi:~$ bluetoothctl
[bluetooth]# discoverable on
[bluetooth]# agent on
[bluetooth]# power on
[bluetooth]# default-agent
[bluetooth]# quit

create a service  rfcomm to take the serial port connection and redirect to a tty

Code: [Select]
pi@raspberrypi:~$ sudo nano /etc/systemd/system/rfcomm.service

add the following

Code: [Select]
[Unit]
Description=RFCOMM service
After=bluetooth.service
Requires=bluetooth.service
 
[Service]
ExecStart=/usr/bin/rfcomm watch hci0 1 getty rfcomm0 115200 vt100 -a pi
 
[Install]
WantedBy=multi-user.target

make the service start at boot

Code: [Select]
pi@raspberrypi:~$ sudo systemctl enable rfcomm
« Last Edit: March 09, 2017, 07:29:02 by atomiclama »
Wasdale X, Ow that hurt

Offline atomiclama

  • Trade Count: (3)
  • Hero Member
  • *****
  • Posts: 2515
  • Liked: 805
  • Country: gb
  • Uhh! What's that then, Oh! new project.
Network config
« Reply #2 on: March 07, 2017, 13:06:11 »
Network controlled from the interfaces file

Code: [Select]
sudo nano /etc/network/interfaces

I want a simple network that just connects to my home wifi and gets an IP through dhcp.
Make sure that there is a section as follows
 
Code: [Select]
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

auto brings the wlan0 up at boot. Something I just learnt.

Now the wifi configuration takes place in the wpa_supplicant.conf file

Code: [Select]
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

Add one section for each access point you want to be able to use.

Code: [Select]
network={
    ssid="atomiclama"
    psk="password"
}
« Last Edit: December 08, 2017, 10:48:41 by atomiclama »
Wasdale X, Ow that hurt

Offline atomiclama

  • Trade Count: (3)
  • Hero Member
  • *****
  • Posts: 2515
  • Liked: 805
  • Country: gb
  • Uhh! What's that then, Oh! new project.
Camera and python bits
« Reply #3 on: March 07, 2017, 13:06:30 »
Camera, well that was painless.

Hook the HW up and enable the camera via the config tool.

Code: [Select]
raspi-config

Test with tools that come as standard. This should produce a jpg file and also give a preview on attached monitor.

Code: [Select]
raspistill -o image.jpg

Now that';s working we need to install picamera python stuff.

Code: [Select]
sudo apt install python-picamera python3-picamera

Python Image Library

Code: [Select]
sudo apt install python-imaging

Python gpio zero

Code: [Select]
sudo apt install python-gpiozero
« Last Edit: December 08, 2017, 10:46:16 by atomiclama »
Wasdale X, Ow that hurt

Offline atomiclama

  • Trade Count: (3)
  • Hero Member
  • *****
  • Posts: 2515
  • Liked: 805
  • Country: gb
  • Uhh! What's that then, Oh! new project.
Using BTRFS
« Reply #4 on: March 07, 2017, 13:25:46 »
Today I'm most playing with btrfs, read a few reviews and it looks to be better than ext4 which is the default. So here is how I converted over to this fs.

Install the btrfs tools on the pi

Code: [Select]
sudo apt-get install btrfs-tools
Edit the modules file and add 'btrfs' to the end.
Code: [Select]
sudo nano /etc/initramfs-tools/modules
update the initfs with the new modules, get the version from 'uname -r'

Code: [Select]
update-initramfs -c -k 4.9.35+
Modify '/boot/config.txt'
and add to the bottom
Code: [Select]
initramfs initrd.img-4.9.35+
modify '/etc/fstab'
Code: [Select]
/dev/mmcblk0p2  /               btrfs   noatime,nodiratime          0       0
modify '/boot/cmdline.txt'
Code: [Select]
rootfstype=btrfs
shutdown the pi and put the SD card in another linux PC

This part is done from the PC

make a back up of the two partitions, I use 'sudo rsync -a --progress' for this.

To be safe I created on a fresh SD the default image then removed the second partition and created a new one that filled all remaining space.

format this new partition with btrfs
Quote
sudo mkfs.btrfs /dev/mmcblk0p2

Now restore the boot and fs partitions on the newly created SD card.

unmount, transfer back to the pi and power up, enjoy!
« Last Edit: December 08, 2017, 11:22:23 by atomiclama »
Wasdale X, Ow that hurt

Offline ched999uk

  • Trade Count: (0)
  • Hero Member
  • *****
  • Posts: 3078
  • Liked: 671
  • Country: gb
Re: Atomic's adventures with a Pi Zero W
« Reply #5 on: March 07, 2017, 16:32:51 »
Great info, thanks. What OS are you using?

Offline atomiclama

  • Trade Count: (3)
  • Hero Member
  • *****
  • Posts: 2515
  • Liked: 805
  • Country: gb
  • Uhh! What's that then, Oh! new project.
Re: Atomic's adventures with a Pi Zero W
« Reply #6 on: March 08, 2017, 07:31:23 »
Great info, thanks. What OS are you using?
Just the raspian lite one from here
https://www.raspberrypi.org/downloads/raspbian/
Wasdale X, Ow that hurt

Offline atomiclama

  • Trade Count: (3)
  • Hero Member
  • *****
  • Posts: 2515
  • Liked: 805
  • Country: gb
  • Uhh! What's that then, Oh! new project.
DHCP server
« Reply #7 on: March 09, 2017, 07:27:34 »
This is how I have the eth0 setup as a DHCP server for my mobile network.

Install dnsmasq as a DHCP server
Code: [Select]
sudo apt install dnsmasq
Stop the service so that we can configure it.
Code: [Select]
sudo systemctl stop dnsmasq
Modify the DHCP client config so that network interface is not considered for dhcp configuration.
Code: [Select]
sudo nano /etc/dhcpcd.conf
Add this some where
Code: [Select]
denyinterfaces eth0   
Modify the network interfaces file for s static IP   
Code: [Select]
sudo nano /etc/network/interfaces   
Code: [Select]
allow-hotplug eth0
auto eth0

iface eth0 inet static 
    address 192.168.0.1
    netmask 255.255.255.0
    network 192.168.0.0
   
modify the dnsmasq config file so that it acts as a DHCP server.
Code: [Select]
sudo nano /etc/dnsmasq.conf

Code: [Select]
interface=eth0      # Use the required interface
dhcp-range=192.168.0.2,192.168.0.20,255.255.255.0,24h

Start the service
Code: [Select]
sudo systemctl stop dnsmasq
« Last Edit: December 08, 2017, 14:22:00 by atomiclama »
Wasdale X, Ow that hurt

Offline atomiclama

  • Trade Count: (3)
  • Hero Member
  • *****
  • Posts: 2515
  • Liked: 805
  • Country: gb
  • Uhh! What's that then, Oh! new project.
Re: Using BTRFS
« Reply #8 on: December 08, 2017, 10:59:38 »
« Last Edit: December 08, 2017, 11:20:53 by atomiclama »
Wasdale X, Ow that hurt

Offline ched999uk

  • Trade Count: (0)
  • Hero Member
  • *****
  • Posts: 3078
  • Liked: 671
  • Country: gb
Re: Atomic's adventures with a Pi Zero W
« Reply #9 on: December 08, 2017, 20:27:28 »
How far did you get with the project?

Offline atomiclama

  • Trade Count: (3)
  • Hero Member
  • *****
  • Posts: 2515
  • Liked: 805
  • Country: gb
  • Uhh! What's that then, Oh! new project.
Re: Atomic's adventures with a Pi Zero W
« Reply #10 on: December 08, 2017, 22:47:22 »
It's still ongoing, what is here is basically a brain dump so I can find the info again and is the current state apart from the code side. That'll be in git when I get it to a satisfactory state.

Wasdale X, Ow that hurt