Tag Archives: skateboard

Track your speed and distance while skateboarding

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/speed-distance-tracking-skateboard/

Fight the urge to chant the Avril Lavigne song as you cruise the streets on Pieter Thomas’s speed- and distance-tracking skateboard.

Speed and distance tracking Raspberry Pi skateboard

Instant approval

“That is sweet!” exclaimed Ben Nuttall when I shared this project on the Raspberry Pi Slack channel. And indeed it is — a simple idea, perfectly executed, resulting in a final product that actually managed to coax a genuine and positive response from Ben!

Prove your worth ☑

Project creator Pieter Thomas, a student at Howest Kortrijk University, needed to show off his skills by building a ‘something’ for his course. His inspiration?

I came up with this idea because I like to skate and cruise around. While I’m cruising, it would be handy to see how much distance I’ve travelled and see my speed.

So he decided to incorporate an odometer, a speedometer, and an RFID reader into a skateboard to produce this neat build.

Make and skate

While Pieter has an Arduino manage the onboard RFID reader, he’s put a Raspberry Pi 3 in charge of everything else, including the speed and distance readings taken with the help of a hall effect sensor (a transducer that uses magnetic fields to manage voltage output).

Speed and distance tracking Raspberry Pi skateboard

Pieter added the RFID reader to identify different users, with databases allowing for session data collection — perfect for time and speed challenges among friends!

Home-brew casing

All the electronics live in a Tupperware-like container that Pieter screwed to the bottom of the board. Holes in the deck display an LCD screen, a potentiometer, and a buzzer.

Speed and distance tracking Raspberry Pi skateboard

To allow speed and distance calculations, Pieter drilled a hole into one of the wheels and inserted a magnet. Once per wheel rotation, the hall effect sensor recognises the passing magnet. The build records the time taken between passes, computes the speed and distance covered, and shows them on the LCD screen.

Pieter’s Instructables project page goes into a lot more detail of how to build your own skate-o-meter. If you’ve used a Pi for your skateboarding project, make sure to let us know!

Skateboard + Pi

Other impressive Raspberry Pi–based board builds include Tim Maier’s motorised skateboard, aka the first blog post I ever wrote for Raspberry Pi, and Matt ‘The Raspberry Pi Guy’ Timmons-Brown’s 30kmph longboard, aka the project that resulted in this video of Raspberry Pi’s Director of Software Engineering:

Sk8r Pi ft. The Raspberry Pi Guy… and Gordon

The Raspberry Pi Guy popped into Pi Towers to show off his new creation. While skating up and down the office on his Pi-powered skateboard, our Director of Software Engineering, Gordon Hollingworth, decided to have a go.

The post Track your speed and distance while skateboarding appeared first on Raspberry Pi.

Community Profile: Matthew Timmons-Brown

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/community-profile-matthew-timmons-brown/

This column is from The MagPi issue 57. You can download a PDF of the full issue for free, or subscribe to receive the print edition in your mailbox or the digital edition on your tablet. All proceeds from the print and digital editions help the Raspberry Pi Foundation achieve its charitable goals.

“I first set up my YouTube channel because I noticed a massive lack of video tutorials for the Raspberry Pi,” explains Matthew Timmons-Brown, known to many as The Raspberry Pi Guy. At 18 years old, the Cambridge-based student has more than 60 000 subscribers to his channel, making his account the most successful Raspberry Pi–specific YouTube account to date.

Matthew Timmons-Brown

Matt gives a talk at the Raspberry Pi 5th Birthday weekend event

The Raspberry Pi Guy

If you’ve attended a Raspberry Pi event, there’s a good chance you’ve already met Matt. And if not, you’ll have no doubt come across one or more of his tutorials and builds online. On more than one occasion, his work has featured on the Raspberry Pi blog, with his yearly Raspberry Pi roundup videos being a staple of the birthday celebrations.

Matthew Timmons-Brown

With his website, Matt aimed to collect together “the many strands of The Raspberry Pi Guy” into one, neat, cohesive resource — and it works. From newcomers to the credit card-sized computer to hardened Pi veterans, The Raspberry Pi Guy offers aid and inspiration for many. Looking for a review of the Raspberry Pi Zero W? He’s filmed one. Looking for a step-by-step guide to building a Pi-powered Amazon Alexa? No problem, there’s one of those too.

Make your Raspberry Pi artificially intelligent! – Amazon Alexa Personal Assistant Tutorial

Artificial Intelligence. A hefty topic that has dominated the field since computers were first conceived. What if I told you that you could put an artificial intelligence service on your own $30 computer?! That’s right! In this tutorial I will show you how to create your own artificially intelligent personal assistant, using Amazon’s Alexa voice recognition and information service!

Raspberry Pi electric skateboard

Last summer, Matt introduced the world to his Raspberry Pi-controlled electric skateboard, soon finding himself plastered over local press as well as the BBC and tech sites like Adafruit and geek.com. And there’s no question as to why the build was so popular. With YouTubers such as Casey Neistat increasing the demand for electric skateboards on a near-daily basis, the call for a cheaper, home-brew version has quickly grown.

DIY 30KM/H ELECTRIC SKATEBOARD – RASPBERRY PI/WIIMOTE POWERED

Over the summer, I made my own electric skateboard using a £4 Raspberry Pi Zero. Controlled with a Nintendo Wiimote, capable of going 30km/h, and with a range of over 10km, this project has been pretty darn fun. In this video, you see me racing around Cambridge and I explain the ins and outs of this project.

Using a Raspberry Pi Zero, a Nintendo Wii Remote, and a little help from members of the Cambridge Makespace community, Matt built a board capable of reaching 30km/h, with a battery range of 10km per charge. Alongside Neistat, Matt attributes the project inspiration to Australian student Tim Maier, whose build we previously covered in The MagPi.

Matthew Timmons-Brown and Eben Upton standing in a car park looking at a smartphone

LiDAR

Despite the success and the fun of the electric skateboard (including convincing Raspberry Pi Trading CEO Eben Upton to have a go for local television news coverage), the project Matt is most proud of is his wireless LiDAR system for theoretical use on the Mars rovers.

Matthew Timmons-Brown's LiDAR project for scanning terrains with lasers

Using a tablet app to define the angles, Matt’s A Level coursework LiDAR build scans the surrounding area, returning the results to the touchscreen, where they can be manipulated by the user. With his passion for the cosmos and the International Space Station, it’s no wonder that this is Matt’s proudest build.

Built for his A Level Computer Science coursework, the build demonstrates Matt’s passion for space and physics. Used as a means of surveying terrain, LiDAR uses laser light to measure distance, allowing users to create 3D-scanned, high-resolution maps of a specific area. It is a perfect technology for exploring unknown worlds.

Matthew Timmons-Brown and two other young people at a reception in the Houses of Parliament

Matt was invited to St James’s Palace and the Houses of Parliament as part of the Raspberry Pi community celebrations in 2016

Joining the community

In a recent interview at Hills Road Sixth Form College, where he is studying mathematics, further mathematics, physics, and computer science, Matt revealed where his love of electronics and computer science started. “I originally became interested in computer science in 2012, when I read a tiny magazine article about a computer that I would be able to buy with pocket money. This was a pretty exciting thing for a 12-year-old! Your own computer… for less than £30?!” He went on to explain how it became his mission to learn all he could on the subject and how, months later, his YouTube channel came to life, cementing him firmly into the Raspberry Pi community

The post Community Profile: Matthew Timmons-Brown appeared first on Raspberry Pi.

MagPi 59: the Raspberry Pi PC Challenge

Post Syndicated from Lucy Hattersley original https://www.raspberrypi.org/blog/magpi-59/

Hey everyone, Lucy here! I’m standing in for Rob this month to introduce The MagPi 59, the latest edition of the official Raspberry Pi magazine.

The MagPi 59

Ever wondered whether a Pi could truly replace your home computer? Looking for inspiration for a Pi-powered project you can make and use in the sunshine? Interested in winning a Raspberry Pi that’s a true collector’s item?

Then we’ve got you covered in Issue 59, out in stores today!

The MagPi 59

Shiny and new

The Raspberry Pi PC challenge

This month’s feature is fascinating! We set the legendary Rob Zwetsloot a challenge: use no other computer but a Raspberry Pi for a week, and let us know how it goes – for science!

Is there anything you can’t do with a $35 computer? To find out, you just have to read the magazine.

12 summer projects

We’re bringing together some of the greatest outdoor projects for the Raspberry Pi in this MagPi issue. From a high-altitude balloon, to aerial photography, to bike computers and motorised skateboards, there’s plenty of bright ideas in The MagPi 59.

12 Summer Projects in The MagPi 59

Maybe your Pi will ripen in the sun?

The best of the rest in The MagPi 59

We’ve got a fantastic collection of community projects this month. Ingmar Stapel shows off Big Rob, his SatNav-guided robot, while Eric Page demonstrates his Dog Treat Dispenser. There are also interesting tutorials on building a GPS tracker, controlling a Raspberry Pi with an Android app and Bluetooth, and building an electronic wind chime with magnetometers.

You can even enter our give-away of 10 ultra-rare ‘Raspberry Pi 3 plus official case’ kits signed by none other than Eben Upton, co-creator of the Raspberry Pi. Win one and be the envy of the entire Raspberry Pi community!

Electronic Wind Chimes - MagPi 59

MAGNETS!

You can find The MagPi 59 in the UK right now, at WHSmith, Sainsbury’s, Asda, and Tesco. Copies will be arriving in US stores including Barnes & Noble and Micro Center very soon. You can also get a copy online from our store or via our Android or iOS app. And don’t forget: there’s always the free PDF as well.

Get reading, get making, and enjoy the new issue!

Rob isn’t here to add his signature Picard GIF, but we’ve sorted it for him. He loves a good pun, so he does! – Janina & Alex

The post MagPi 59: the Raspberry Pi PC Challenge appeared first on Raspberry Pi.

New product! Raspberry Pi Zero W joins the family

Post Syndicated from Eben Upton original https://www.raspberrypi.org/blog/raspberry-pi-zero-w-joins-family/

Today is Raspberry Pi’s fifth birthday: it’s five years since we launched the original Raspberry Pi, selling a hundred thousand units in the first day, and setting us on the road to a lifetime total (so far) of over twelve million units. To celebrate, we’re announcing a new product: meet Raspberry Pi Zero W, a new variant of Raspberry Pi Zero with wireless LAN and Bluetooth, priced at only $10.

Multum in parvo

So what’s the story?

In November 2015, we launched Raspberry Pi Zero, the diminutive $5 entry-level Raspberry Pi. This represented a fivefold reduction in cost over the original Model A: it was cheap enough that we could even stick it on the front cover of The MagPi, risking civil insurrection in newsagents throughout the land.

MagPi issue 40: causing trouble for WHSmith (credit: Adam Nicholls)

Over the ensuing fifteen months, Zero grew a camera connector and found its way into everything from miniature arcade cabinets to electric skateboards. Many of these use cases need wireless connectivity. The homebrew “People in Space” indicator in the lobby at Pi Towers is a typical example, with an official wireless dongle hanging off the single USB port: users often end up adding a USB hub to allow them to connect a keyboard, a mouse and a network adapter, and this hub can easily cost more than the Zero itself.

People in SPAAAAAACE

Zero W fixes this problem by integrating more functionality into the core product. It uses the same Cypress CYW43438 wireless chip as Raspberry Pi 3 Model B to provide 802.11n wireless LAN and Bluetooth 4.0 connectivity.

Pi Zero Announcement Video

Music: Orqestruh by SAFAKASH – https://soundcloud.com/safakash

To recap, here’s the full feature list for Zero W:

  • 1GHz, single-core CPU
  • 512MB RAM
  • Mini-HDMI port
  • Micro-USB On-The-Go port
  • Micro-USB power
  • HAT-compatible 40-pin header
  • Composite video and reset headers
  • CSI camera connector
  • 802.11n wireless LAN
  • Bluetooth 4.0

We imagine you’ll find all sorts of uses for Zero W. It makes a better general-purpose computer because you’re less likely to need a hub: if you’re using Bluetooth peripherals you might well end up with nothing at all plugged into the USB port. And of course it’s a great platform for experimenting with IoT applications.

Official case

To accompany Raspberry Pi Zero W, we’ve been working with our friends at Kinneir Dufort and T-Zero to create an official injection-moulded case. This shares the same design language as the official case for the Raspberry Pi 3, and features three interchangeable lids:

  • A blank one
  • One with an aperture to let you access the GPIOs
  • One with an aperture and mounting point for a camera

Three cases for the price of one

The case set also includes a short camera adapter flexi, and a set of rubber feet to make sure your cased Zero or Zero W doesn’t slide off the desk.

New distributors

You may have noticed that we’ve added several new Zero distributors recently: ModMyPi in the UK, pi3g in Germany, Samm Teknoloji in Turkey, Kubii in France, Spain, Italy and Portugal, and Kiwi Electronics in the Netherlands, Belgium and Luxembourg.

Raspberry Pi Zero W is available from all Zero distributors today, with the exception of Micro Center, who should have stock in stores by the end of this week. Check the icons below to find the stockist that’s best for you!

UK, Ireland

PimoroniThe Pi Hut

United States

AdafruitCanakitMicrocenter

Canada

Canakit

Germany, Austria, Switzerland

France, Spain, Italy, Portugal

Netherlands, Belgium, Luxembourg

Turkey

Global

PimoroniThe Pi HutAdafruit
Canakit

The post New product! Raspberry Pi Zero W joins the family appeared first on Raspberry Pi.

30kmph Bluetooth skateboard from the Raspberry Pi Guy

Post Syndicated from Liz Upton original https://www.raspberrypi.org/blog/30kmph-bluetooth-skateboard-raspberry-pi-guy/

We are immensely fond of tutorial-maker extraordinaire Matt Timmons-Brown, who you may know as The Raspberry Pi Guy, and we treasure his widdle brain. Matt, please wear a helmet consistently next time you use this skateboard monster thing.

DIY 30KM/H ELECTRIC SKATEBOARD – RASPBERRY PI POWERED

Over the summer, I made my own electric skateboard using a £4 Raspberry Pi Zero. Controlled with a Nintendo Wiimote, capable of going 30km/h, and with a range of over 10km, this project has been pretty darn fun. In this video, you see me racing around Cambridge and I explain the ins and outs of this project.

This is a beautiful build, with a Bluetooth-connected Raspberry Pi Zero controlling the speed of the brushless motor that drives the board. Matt’s using a Wiimote to control the speed, and terrifying the residents of Cambridge into the bargain.

The metal boxes underneath the skateboard that Matt’s made to house the battery and electronics are, in a way, the most important part of the build. When you’re tooling along at 30kmph, the last thing you want to do is to grate your lithium-ion battery on the tarmac at speed.

Matt visited Pi Towers to show us what he’d made, and Gordon had a go. You’ll want to turn the sound on.

Sk8r Pi ft. The Raspberry Pi Guy… and Gordon

The Raspberry Pi Guy popped into Pi Towers to show off his new creation. While skating up and down the office on his Pi-powered skateboard, our Director of Software Engineering, Gordon Hollingworth, decided to have a go.

Beautiful build, Matt – thanks for sharing!

The post 30kmph Bluetooth skateboard from the Raspberry Pi Guy appeared first on Raspberry Pi.

Bluetooth LED bulbs

Post Syndicated from Matthew Garrett original http://mjg59.dreamwidth.org/43722.html

The best known smart bulb setups (such as the Philips Hue and the Belkin Wemo) are based on Zigbee, a low-energy, low-bandwidth protocol that operates on various unlicensed radio bands. The problem with Zigbee is that basically no home routers or mobile devices have a Zigbee radio, so to communicate with them you need an additional device (usually called a hub or bridge) that can speak Zigbee and also hook up to your existing home network. Requests are sent to the hub (either directly if you’re on the same network, or via some external control server if you’re on a different network) and it sends appropriate Zigbee commands to the bulbs.

But requiring an additional device adds some expense. People have attempted to solve this in a couple of ways. The first is building direct network connectivity into the bulbs, in the form of adding an 802.11 controller. Go through some sort of setup process[1], the bulb joins your network and you can communicate with it happily. Unfortunately adding wifi costs more than adding Zigbee, both in terms of money and power – wifi bulbs consume noticeably more power when “off” than Zigbee ones.

There’s a middle ground. There’s a large number of bulbs available from Amazon advertising themselves as Bluetooth, which is true but slightly misleading. They’re actually implementing Bluetooth Low Energy, which is part of the Bluetooth 4.0 spec. Implementing this requires both OS and hardware support, so older systems are unable to communicate. Android 4.3 devices tend to have all the necessary features, and modern desktop Linux is also fine as long as you have a Bluetooth 4.0 controller.

Bluetooth is intended as a low power communications protocol. Bluetooth Low Energy (or BLE) is even lower than that, running in a similar power range to Zigbee. Most semi-modern phones can speak it, so it seems like a pretty good choice. Obviously you lose the ability to access the device remotely, but given the track record on this sort of thing that’s arguably a benefit. There’s a couple of other downsides – the range is worse than Zigbee (but probably still acceptable for any reasonably sized house or apartment), and only one device can be connected to a given BLE server at any one time. That means that if you have the control app open while you’re near a bulb, nobody else can control that bulb until you disconnect.

The quality of the bulbs varies a great deal. Some of them are pure RGB bulbs and incapable of producing a convincing white at a reasonable intensity[2]. Some have additional white LEDs but don’t support running them at the same time as the colour LEDs, so you have the choice between colour or a fixed (and usually more intense) white. Some allow running the white LEDs at the same time as the RGB ones, which means you can vary the colour temperature of the “white” output.

But while the quality of the bulbs varies, the quality of the apps doesn’t really. They’re typically all dreadful, competing on features like changing bulb colour in time to music rather than on providing a pleasant user experience. And the whole “Only one person can control the lights at a time” thing doesn’t really work so well if you actually live with anyone else. I was dissatisfied.

I’d met Mike Ryan at Kiwicon a couple of years back after watching him demonstrate hacking a BLE skateboard. He offered a couple of good hints for reverse engineering these devices, the first being that Android already does almost everything you need. Hidden in the developer settings is an option marked “Enable Bluetooth HCI snoop log”. Turn that on and all Bluetooth traffic (including BLE) is dumped into /sdcard/btsnoop_hci.log. Turn that on, start the app, make some changes, retrieve the file and check it out using Wireshark. Easy.

Conveniently, BLE is very straightforward when it comes to network protocol. The only thing you have is GATT, the Generic Attribute Protocol. Using this you can read and write multiple characteristics. Each packet is limited to a maximum of 20 bytes. Most implementations use a single characteristic for light control, so it’s then just a matter of staring at the dumped packets until something jumps out at you. A pretty typical implementation is something like:

0x56,r,g,b,0x00,0xf0,0x00,0xaa

where r, g and b are each just a single byte representing the corresponding red, green or blue intensity. 0x56 presumably indicates a “Set the light to these values” command, 0xaa indicates end of command and 0xf0 indicates that it’s a request to set the colour LEDs. Sending 0x0f instead results in the previous byte (0x00 in this example) being interpreted as the intensity of the white LEDs. Unfortunately the bulb I tested that speaks this protocol didn’t allow you to drive the white LEDs at the same time as anything else – setting the selection byte to 0xff didn’t result in both sets of intensities being interpreted at once. Boo.

You can test this out fairly easily using the gatttool app. Run hcitool lescan to look for the device (remember that it won’t show up if anything else is connected to it at the time), then do gatttool -b deviceid -I to get an interactive shell. Type connect to initiate a connection, and once connected send commands by doing char-write-cmd handle value using the handle obtained from your hci dump.

I did this successfully for various bulbs, but annoyingly hit a problem with one from Tikteck. The leading byte of each packet was clearly a counter, but the rest of the packet appeared to be garbage. For reasons best known to themselves, they’ve implemented application-level encryption on top of BLE. This was a shame, because they were easily the best of the bulbs I’d used – the white LEDs work in conjunction with the colour ones once you’re sufficiently close to white, giving you good intensity and letting you modify the colour temperature. That gave me incentive, but figuring out the protocol took quite some time. Earlier this week, I finally cracked it. I’ve put a Python implementation on Github. The idea is to tie it into Ulfire running on a central machine with a Bluetooth controller, making it possible for me to control the lights from multiple different apps simultaneously and also integrating with my Echo.

I’d write something about the encryption, but I honestly don’t know. Large parts of this make no sense to me whatsoever. I haven’t even had any gin in the past two weeks. If anybody can explain how anything that’s being done there makes any sense at all[3] that would be appreciated.

[1] typically via the bulb pretending to be an access point, but also these days through a terrifying hack involving spewing UDP multicast packets of varying lengths in order to broadcast the password to associated but unauthenticated devices and good god the future is terrifying

[2] For a given power input, blue LEDs produce more light than other colours. To get white with RGB LEDs you either need to have more red and green LEDs than blue ones (which costs more), or you need to reduce the intensity of the blue ones (which means your headline intensity is lower). Neither is appealing, so most of these bulbs will just give you a blue “white” if you ask for full red, green and blue

[3] Especially the bit where we calculate something from the username and password and then encrypt that using some random numbers as the key, then send 50% of the random numbers and 50% of the encrypted output to the device, because I can’t even

comment count unavailable comments

Bluetooth LED bulbs

Post Syndicated from Matthew Garrett original https://mjg59.dreamwidth.org/43722.html

The best known smart bulb setups (such as the Philips Hue and the Belkin Wemo) are based on Zigbee, a low-energy, low-bandwidth protocol that operates on various unlicensed radio bands. The problem with Zigbee is that basically no home routers or mobile devices have a Zigbee radio, so to communicate with them you need an additional device (usually called a hub or bridge) that can speak Zigbee and also hook up to your existing home network. Requests are sent to the hub (either directly if you’re on the same network, or via some external control server if you’re on a different network) and it sends appropriate Zigbee commands to the bulbs.

But requiring an additional device adds some expense. People have attempted to solve this in a couple of ways. The first is building direct network connectivity into the bulbs, in the form of adding an 802.11 controller. Go through some sort of setup process[1], the bulb joins your network and you can communicate with it happily. Unfortunately adding wifi costs more than adding Zigbee, both in terms of money and power – wifi bulbs consume noticeably more power when “off” than Zigbee ones.

There’s a middle ground. There’s a large number of bulbs available from Amazon advertising themselves as Bluetooth, which is true but slightly misleading. They’re actually implementing Bluetooth Low Energy, which is part of the Bluetooth 4.0 spec. Implementing this requires both OS and hardware support, so older systems are unable to communicate. Android 4.3 devices tend to have all the necessary features, and modern desktop Linux is also fine as long as you have a Bluetooth 4.0 controller.

Bluetooth is intended as a low power communications protocol. Bluetooth Low Energy (or BLE) is even lower than that, running in a similar power range to Zigbee. Most semi-modern phones can speak it, so it seems like a pretty good choice. Obviously you lose the ability to access the device remotely, but given the track record on this sort of thing that’s arguably a benefit. There’s a couple of other downsides – the range is worse than Zigbee (but probably still acceptable for any reasonably sized house or apartment), and only one device can be connected to a given BLE server at any one time. That means that if you have the control app open while you’re near a bulb, nobody else can control that bulb until you disconnect.

The quality of the bulbs varies a great deal. Some of them are pure RGB bulbs and incapable of producing a convincing white at a reasonable intensity[2]. Some have additional white LEDs but don’t support running them at the same time as the colour LEDs, so you have the choice between colour or a fixed (and usually more intense) white. Some allow running the white LEDs at the same time as the RGB ones, which means you can vary the colour temperature of the “white” output.

But while the quality of the bulbs varies, the quality of the apps doesn’t really. They’re typically all dreadful, competing on features like changing bulb colour in time to music rather than on providing a pleasant user experience. And the whole “Only one person can control the lights at a time” thing doesn’t really work so well if you actually live with anyone else. I was dissatisfied.

I’d met Mike Ryan at Kiwicon a couple of years back after watching him demonstrate hacking a BLE skateboard. He offered a couple of good hints for reverse engineering these devices, the first being that Android already does almost everything you need. Hidden in the developer settings is an option marked “Enable Bluetooth HCI snoop log”. Turn that on and all Bluetooth traffic (including BLE) is dumped into /sdcard/btsnoop_hci.log. Turn that on, start the app, make some changes, retrieve the file and check it out using Wireshark. Easy.

Conveniently, BLE is very straightforward when it comes to network protocol. The only thing you have is GATT, the Generic Attribute Protocol. Using this you can read and write multiple characteristics. Each packet is limited to a maximum of 20 bytes. Most implementations use a single characteristic for light control, so it’s then just a matter of staring at the dumped packets until something jumps out at you. A pretty typical implementation is something like:

0x56,r,g,b,0x00,0xf0,0x00,0xaa

where r, g and b are each just a single byte representing the corresponding red, green or blue intensity. 0x56 presumably indicates a “Set the light to these values” command, 0xaa indicates end of command and 0xf0 indicates that it’s a request to set the colour LEDs. Sending 0x0f instead results in the previous byte (0x00 in this example) being interpreted as the intensity of the white LEDs. Unfortunately the bulb I tested that speaks this protocol didn’t allow you to drive the white LEDs at the same time as anything else – setting the selection byte to 0xff didn’t result in both sets of intensities being interpreted at once. Boo.

You can test this out fairly easily using the gatttool app. Run hcitool lescan to look for the device (remember that it won’t show up if anything else is connected to it at the time), then do gatttool -b deviceid -I to get an interactive shell. Type connect to initiate a connection, and once connected send commands by doing char-write-cmd handle value using the handle obtained from your hci dump.

I did this successfully for various bulbs, but annoyingly hit a problem with one from Tikteck. The leading byte of each packet was clearly a counter, but the rest of the packet appeared to be garbage. For reasons best known to themselves, they’ve implemented application-level encryption on top of BLE. This was a shame, because they were easily the best of the bulbs I’d used – the white LEDs work in conjunction with the colour ones once you’re sufficiently close to white, giving you good intensity and letting you modify the colour temperature. That gave me incentive, but figuring out the protocol took quite some time. Earlier this week, I finally cracked it. I’ve put a Python implementation on Github. The idea is to tie it into Ulfire running on a central machine with a Bluetooth controller, making it possible for me to control the lights from multiple different apps simultaneously and also integrating with my Echo.

I’d write something about the encryption, but I honestly don’t know. Large parts of this make no sense to me whatsoever. I haven’t even had any gin in the past two weeks. If anybody can explain how anything that’s being done there makes any sense at all[3] that would be appreciated.

[1] typically via the bulb pretending to be an access point, but also these days through a terrifying hack involving spewing UDP multicast packets of varying lengths in order to broadcast the password to associated but unauthenticated devices and good god the future is terrifying

[2] For a given power input, blue LEDs produce more light than other colours. To get white with RGB LEDs you either need to have more red and green LEDs than blue ones (which costs more), or you need to reduce the intensity of the blue ones (which means your headline intensity is lower). Neither is appealing, so most of these bulbs will just give you a blue “white” if you ask for full red, green and blue

[3] Especially the bit where we calculate something from the username and password and then encrypt that using some random numbers as the key, then send 50% of the random numbers and 50% of the encrypted output to the device, because I can’t even

comment count unavailable comments

Motorised Skateboard

Post Syndicated from Alex Bate original https://www.raspberrypi.org/blog/motorised-skateboard/

Hello there. I’m Alex, the newest inhabitant of Pi Towers. I like to build things like modified Nerf guns and Iron Man masks (Team Stark for life! Sorry Liz), and when I’m not doing that, I get to search for all your amazing Pi projects and share them with the world via our social media. So keep it up!

Since arriving at Pi Towers my imagination has been running on overdrive, thinking of all the possible projects I can do with this incredible micro-powerhouse. I like to make stuff… and now I can make stuff that does stuff, thanks to the versatility of the Pi.

With this in mind, it’s no surprise that my return from lunch on my first day with a skateboard under my (rain-sodden) arm was met with this project in an email from Liz.

No Title

No Description

A Raspberry Pi-powered motorised skateboard, controlled via a Wii Remote? What’s not to love? The skateboard, Raspberry Pi, and console gaming enthusiast in me rejoiced as I wrung rainwater from my hoodie.

raspberry pi skateboard

As part of a university assignment to produce a project piece that incorporates a Raspberry Pi, Tim Maier constructed this beast of a machine using various components that are commonly found over the internet or at local tech stores. Essentially, Tim has provided me with the concept for my first Raspberry Pi project and I already have the deck at my disposal. And a Raspberry Pi. Motors and batteries litter the cupboards at Pi Towers like dead moths. And I’m sure there’s somebody around here I can beg a Wiimote from.

Raspberry Pi Bluetooth Electric Skateboard IFB102

This project was part of an assignment for university where the prerequisite was to build something with a Raspberry Pi.

What I really love about this project is that once again we see how it’s possible to build your own tech items, despite how readily available the complete builds are online or in stores. Not only do you save money – and in the case of a motorised skateboard, we’re easily talking hundreds of pounds – but you also get that added opportunity to smugly declare “Oh this? I made it myself” that you simply don’t get when opening the packaging of something pre-made.

Hats (or skate caps) off to Tim and this wonderful skateboard. Tim: if you’re reading this, I’d love to know what your final mark was!

The post Motorised Skateboard appeared first on Raspberry Pi.