E-Bike phone home | Raspberry Pi w/ GPS tracking public WiFi

4dtwo

1 µW
Joined
May 22, 2016
Messages
4
I am starting a project to have a Raspberry Pi powered via DC-DC 36or48V -12V converter in a enclosure with my controller. The primary function will be constantly seeking out Free Public WiFi, Or WiFi behind a captive portal (automatically agree to terms to enable internet) and dumping GPS coordinates (incase the ebike is ever stolen) along with Cycle Analyst data (Cycle analyst USB > TTY Serial connection and graphing all output data)

Once connected to the internet all bike data will be dumped to the cloud via rsync, email or FTP.
Bike data will include:
  • All tracking data (Complete GPS route)
    Elevation
    Speed (GPS)
    Speed (Cycle Analyst)
    AH since last trip
    AH Total
    KM/h
    KM current trip
    Watt Hours Total
    Watt Hours Current Trip

Here is a concept drawing
3JgPnN8.png


If any one owns a Raspberry Pi and wants to contribute to this project please feel free! The first step is to determine how to successfully connect to Free WiFi Hotspots and I have found two methods on how to do this so far. 1. is Portal Smash https://github.com/ussjoin/portalsmash and the other freewifi_autoconnect.sh http://true-random.com/homepage/projects/wifi/

A How to guide will eventually be posted on the projects Git Hub - https://github.com/cws4204/e-picycle A custom Distro will also soon likely follow.
 
This is a neat idea. I was planning to do something along these lines on my ebike eventually.

I have a different take on the implementation, and may possibly be simpler.
My plan was to use an android device in conjunction with a tracking/data logging app.
The reason I find this a more viable solution is because the phone can have a cellular connection vs. having to rely on the availability of wifi.
Don't misunderstand, wifi is fine. You can track the bike, as long as there is wifi. So if someone steals your bike, you can track it to the edge of town where it last makes contact.
Then what? Bike is gone.

And I know, everyone is going to comment on the fact that you have to pay for a cellular service. Normally this would be true, but......
There are actually a few companies that offer free cell service. And I am not talking about services paid for by tax payers.
Check out FreedomPop and RingPlus. Both are running on Sprint's network, which is CDMA. But, both offer LTE on Sprint.
And recently FreedomPop has been offering a GSM sim overseas, and is now opening a beta program for the US.
If you sign up for either, just make sure to follow the rules (esp. on FreedomPop) and you will not get charged anything. Basically you pay the initial fee to sign up, and that is it. No monthly fee.

I have phones on both services. It -IS- Sprint service, remember that. It wont compare to Verizon or AT&T. FreedomPop's GSM service is actually using T-Mobile and AT&T 3g HSPA+. No LTE on the GSM yet.


Sorry if that is intruding on the subject, but I felt is was worthy of being noted. I saw your thread and thought you (or others) would like to consider this option.
And do keep in mind, you can still fall back to wifi on whatever phone you use.

Happy to answer any questions.
 
I agree that a cell phone with a data connection would be much easier for some tasks, but I personally would not be able to implement my plans with just a phone. Where I have confidence to make this work with Raspberry Pi. I wonder how long it would take a thief to remove the cell phone from a stolen ebike vs a Pi integrated to with the electronics.

A SIM card with a data connection could also be integrated with the raspberry pi for continuous tracking and data logging.

I do also have a idea of relocating the Cycle Analyst off the handlebar, in with the controller box then have Cycle Analyst outputting Serial data to Raspberry Pi with a old android phone on the handlebars which could make very customized displays, counters and gauges of the crazy amounts of bike data coming out of the cycle analyst serial port.
 
As far as reading ALL the data coming from the CA, I am not sure if an android phone could do that. Maybe a custom flashed Nexus device.
Now if there is a cellular module for the Rpi that can work on Sprint, that might be an option. They way that FreedomPop provisions devices using the GSM sims is sorta weird. I don't know if slapping a FP sim in a GSM module would work properly.

If you are worried about someone seeing a "phone" and attempting to remove it, you could always strip the phone and just use the board. H3LL, remove the camera, run some extension wires, drill a tiny hole in the seat tube, and mount it inside. No one would find it, and then you could pull images/video if needed.
You could even dial up the bike, put it on speakerphone, and haunt the F out of the thief :D :D :D

So many possibilities!!! Think I am going to have fun with this...
I've got other ideas, but I shall save those for the unsuspecting :twisted:
 
Sorry but dont you need a "freely given" generic common username and a generic common password for most (if not all) public WiFi ports, plus clicking on and agreeing to the terms of service which you mentioned. I would not mind a cell phone SIM card option as well. Kind of a double backup.

Great idea though.

Shaw has a public wifi system in Calgary. Even out in the community away from big places they got them setup in some community malls. I assume they just use cell towers, but not all.... just places where people congregate.
 
I am in Canada as well. Configuring the Pi to connect to the Shaw hot spots is a great idea as they are all over the place!

The wifi seeking scripts I am working on getting running should have no problem with clicking through and answering yes to the hotspot agreement (PortalSmash).

Once I get the above step complete (hopefully this week) I am excited to get the Cycle Analyst connected to the Pi and start dumping data, Perhaps into a MySQL database, RRDtool or even a flat file. Once the data can be parsed with a graphing engine there will be some very interesting and beautiful data representation on the battery health and 'ebike stats'!
 
markz said:
Sorry but dont you need a "freely given" generic common username and a generic common password for most (if not all) public WiFi ports, plus clicking on and agreeing to the terms of service which you mentioned.
Some yes, some no.

There's actually quite a few fastfood and other places that have free wifi in my general area that have converted from requiring you to agree to a TOS page to just being able to straight up connect. But others that used to do that now have a TOS page, so....it depends. :)


Then there is the very small percentage of home wifi routers that are still unsecured (pretty much just the few old routers that haven't been replaced with newer ones that default to some level of security "on"). Though there are also some people that do run a deliberately unsecured wifi router that doesnt' require any login or password.


Unfortunately, at least in my area, there is very little unsecured wifi. (I used to depend on that for all internet access for a long while after the housefire, until end of last year sometime).
 
I have the cycle analyst dumping hundreds of data points a minute into a influxdb database which is then queried by grafana to display the collected data.

I went for a 28km roundtrip cruise and this is the data that was collected.

I can generate any combination of graph I choose and I believe I can now do math on this data to genearte other info such as wattage, watt hours / km, etc.

Ver5YPf.png


http://i.imgur.com/Ver5YPf.png
 
That's pretty cool dood. I likes
Does the CA show throttle percentage? I have not bought mine yet to play with.
It would be neat to see the throttle% along with the voltage drops to determine the pull down under load at different speeds.
Keep it goin. I will be watching.
 
Didn't read more the first post so pardon if this already came up.
I like your idea very much, using a RPI to track but wouldn't a 3/4 G connection be a better choice? I mean if bike is moved outside city area most homes these days are not running wide open WIFI. So if a stolen bike is moved away from the city you might end up loosing track of the bike.

If you first do a RPI connection it would be awesome if you could tap into some of the data from Cycle analyst and display those data onto any screen, ie smartphone or tablet. Would be great to see battery range, usage, speed, and heck why not even show acceleration from dead stop to max speed? It's doable via GPS. You could also do wireless break light, via acceleration sensors added and probably a lot of other cool stuff with various sensors.

  • NFC sensor for various cool things, ie choose to start and make bike ready to roll.
  • Temp sensor for outside temp, or a dual temp/humidity sensor
  • Reading motor temp and controller temp
  • Proximity sensor
  • Motion sensor
  • Accleleration sensor
  • Gyro

If you make this to sell to other e-bikers I would be in for sure. But I think sim card connection for data transfer would be required as well as the option to use smartphone as a smart display to show and display data such as battery info, speed etc.

Look forward to see your project evolve and complete.
 
Back
Top