I've been working on retrieving GPS coordinates for Android, and although it's been a little difficult and confusing sometimes I've figured out some cool things I can set up for this app.
What I've got so far:
- GPS coordinates through both the network and GPS provider (and without the usage of mobile data or WiFi now)
- Able to send the coordinates and provider name to a number through a text (after pressing a button)
What I plan to get:
- App replies depending on what you text the phone (e.g. text "gps" to the phone to have it reply with the coordinates, maybe even have different words for using from different providers)
- Auto-text a number with coordinates every so many minutes (for security, in case it loses service or something goes wrong with the auto-reply, etc.)
I also want to implement the ability to switch between providers for accuracy, power usage, and provider availability purposes.
With both WiFi and data disabled, the network provider was still quick, but quite inaccurate compared to before (pointed to the center of the town, when I was on the edge of town, so about 1km off), but with using the GPS provider with no data or WiFi, it was a little slower retrieving coordinates, and was a little inaccurate the first time retrieving (since the GPS provider takes a while to warm up) but after the first refresh, every set of coordinates after was on top of the house, only varying a couple of feet at max after each refresh.
Friday, December 20, 2013
Tuesday, December 10, 2013
Progress Update - Alternative to Pi Wifi
Since we had an issue with connecting to the Pi through WiFi (stably) James had a great idea of using a smartphone in our Pi's case, since Android phones have data, WiFi, and a GPS.
So for the next little while, each one of us has our own job:
Tyler - Planning our case, getting materials
Kyle - Programming an Android app to send GPS coordinates
James - Setting up a phone to use, also wants to get a way to stream the video from the Pi
So far, I've gotten my GPS app to use the network provider to instantly find GPS coordinates and also set up a way to text the coordinates to a number. It also uses an unexpectedly small amount of data to retrieve coordinates, so we don't have to worry about using too much mobile data on our phone. For the GPS I'm using the network provider, which is known to use very little power, be very fast, but has an accuracy of only 200ft. Although so far that I've used it, it's been so accurate that it knows exactly where I'm sitting in my house.
So for the next little while, each one of us has our own job:
Tyler - Planning our case, getting materials
Kyle - Programming an Android app to send GPS coordinates
James - Setting up a phone to use, also wants to get a way to stream the video from the Pi
So far, I've gotten my GPS app to use the network provider to instantly find GPS coordinates and also set up a way to text the coordinates to a number. It also uses an unexpectedly small amount of data to retrieve coordinates, so we don't have to worry about using too much mobile data on our phone. For the GPS I'm using the network provider, which is known to use very little power, be very fast, but has an accuracy of only 200ft. Although so far that I've used it, it's been so accurate that it knows exactly where I'm sitting in my house.
Sunday, November 3, 2013
Connecting to the Pi Ad-hoc and Wireless
James and I successfully figured out how to connect to the Raspberry Pi using Wifi without a router. We were able to use the Raspberry Pi to host it as a router, and then connect the Pi to it's own router, and then connect to the Pi's Wireless network. Once we got this setup (and working) we were successfully able to access the Pi through SSH, ping it, stream video from it, etc.
James was able to find out how to host the Pi as a router from here. (This tutorial could also be helpful)
At first, we had a couple of problems with actually accessing the Pi. We could host the Wifi network and connect to it from another device without a problem (keep in mind that since it's Ad-hoc, only one device can be on the network at a time) but to actually talk to the Pi itself we had to do some things in "wpa_supplicant" (/etc/wpa_supplicant/wpa_supplicant.conf) and "interfaces" (/etc/network/interfaces) and had to set our other devices to have a static local IP since we did not have a DHCP set up on the Pi. We had to set the network and the connection to it to Ad-hoc mode, and then enter the router's information into the Pi so that the Pi itself could connect to it's own router.
Next I have to work on making a sharing folder on another device accessible as a directory (one I can use the cd command to get into) and make the script so it can save a copy of the picture/video to that sharing folder (when it is accessible) and to it's own storage at the same time.
James was able to find out how to host the Pi as a router from here. (This tutorial could also be helpful)
At first, we had a couple of problems with actually accessing the Pi. We could host the Wifi network and connect to it from another device without a problem (keep in mind that since it's Ad-hoc, only one device can be on the network at a time) but to actually talk to the Pi itself we had to do some things in "wpa_supplicant" (/etc/wpa_supplicant/wpa_supplicant.conf) and "interfaces" (/etc/network/interfaces) and had to set our other devices to have a static local IP since we did not have a DHCP set up on the Pi. We had to set the network and the connection to it to Ad-hoc mode, and then enter the router's information into the Pi so that the Pi itself could connect to it's own router.
Next I have to work on making a sharing folder on another device accessible as a directory (one I can use the cd command to get into) and make the script so it can save a copy of the picture/video to that sharing folder (when it is accessible) and to it's own storage at the same time.
Wednesday, October 16, 2013
Picture Script (Pi Camera Assignment)
Raspberry Pi Picture-take Script
As other students and groups worked on setting up the Raspberry Pi's with Raspbian and such, I took the time to create our script for taking pictures. The script, which is written in shell script (.sh file), is designed to take a photo, numbering each one starting from 1, put them in the pictures directory, and repeat every so many seconds.
Script: http://codepad.org/gRDXkKKO
To run:
- Paste the code into a text or .sh file (if you paste in a .txt, rename the extension to .sh, or it cannot be executed by the terminal)
- Change the repeat time and save directory to what you require
- Open the .sh file and click "Run" (not "Run in terminal")
if you're executing through terminal, cd to the directory (e.g. "cd /home/pi/Desktop), then do "./[SCRIPT NAME].sh
example:
cd /home/pi/Desktop
./script.sh
To close:
- Open task manager (should be under "Advanced" or something similar)
- Right click on [SCRIPT NAME].sh and click stop
Possible flaws:
- The script restarts the numbering each time it is run. If the script has been run before in the same directory and has taken pictures, it may overwrite the pictures in there as it takes more pictures.
Subscribe to:
Posts (Atom)
