#139487 - 03/02/2003 09:26
GPSApp suggestion- way to send info to other progs
|
old hand
Registered: 09/01/2002
Posts: 702
Loc: Tacoma,WA
|
I have a suggestion to GPSApp- why not make a file (called Named Pipes or FIFO in unix?) that other processes can read from to get the current coordinates and speed (and maybe other stuff?) from GPSApp. I'm sure people can think of a lot of useful apps that will read the vehicle's speed and do something with it.
I have another feature suggestion to GPSapp also: Calculating the sunrise/sunset time for the current location. This information is very useful to me as an amateur photographer. I found some code that does this and I'm going to get it working on the empeg. If I get it into a function form would the author of GPSApp, jaharkes?, be interesting it into integrating into the UI for me?
|
Top
|
|
|
|
#139488 - 03/02/2003 10:14
Re: GPSApp suggestion- way to send info to other progs
[Re: siberia37]
|
carpal tunnel
Registered: 24/12/2001
Posts: 5528
|
That would only work for a single external program unless you're willing to have a fifo for each.
I guess you could implement it as a socket though.
- Trevor
|
Top
|
|
|
|
#139489 - 03/02/2003 11:00
Re: GPSApp suggestion- way to send info to other progs
[Re: siberia37]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
|
Calculating the sunrise/sunset time for the current location.
COOL. That's a nifty idea for GPS software I hadn't thought of yet. I can think of a lot of uses for this. For instance, I have a friend who follows a religious tradition of fasting during the daylight hours on certain days of the year. For him, the exact moments of sunset and sunrise become rather critical.
What other neat things can we do with a GPS that aren't necessarily obvious right off the bat? Here's what I've seen so far:
- Automatically set the player's time clock and time zone, and keep them accurate.
- Calculate sunrise/sunset as described above.
- Use a database to warn when you're near a fixed speed-camera trap or other similar civil-revenue-generator.
Anyone else have any ideas? Sitting here thinking about it, I imagined another one: Astronomy. Calculate what planets and constellations would normally be visible from your current location and time, and list them with directions to locate them. Dunno if the empeg screen is large enough for an actual full-sky display, though. It'd have to be just a sliver of the sky that you could scroll.
Ooo, would make a cool visual, though... have the display be an accurate picture of the horizon, based on location and heading. For instance, if the moon is setting on the horizon with Venus next to it, you'll see that on the empeg screen if you happen to be driving west. And then it could have symbols up on the screen telling you what you're seeing.
|
Top
|
|
|
|
#139490 - 03/02/2003 11:43
Re: GPSApp suggestion- way to send info to other p
[Re: siberia37]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
Making a file requires remounting a filesystem read/write.
|
Top
|
|
|
|
#139491 - 03/02/2003 11:46
Re: GPSApp suggestion- way to send info to other p
[Re: tfabris]
|
addict
Registered: 14/01/2002
Posts: 443
Loc: Raleigh, NC
|
That would be pretty neat.. Would also be cool to have the Knob rotate through highlighting the displayed stars, and give name/info..
|
Top
|
|
|
|
#139492 - 03/02/2003 11:48
Re: GPSApp suggestion- way to send info to other p
[Re: Daria]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
requires remounting a filesystem read/write.
Yes, *creating* a file requires r/w mount. Once it's created, though, updating it in-place could be done with raw writes to the disk, even with the drive mounted ro. This is on the list of Hijack features that would be nice to have someday, but haven't created a high enough demand for Mark to implement it.
|
Top
|
|
|
|
#139493 - 03/02/2003 11:49
Re: GPSApp suggestion- way to send info to other p
[Re: tonyc]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
There's no point in counting on using features that don't exist. There's probably a better way.
|
Top
|
|
|
|
#139494 - 03/02/2003 12:05
Re: GPSApp suggestion- way to send info to other p
[Re: Daria]
|
enthusiast
Registered: 14/09/2000
Posts: 363
|
Since a fifo doesn't store any data on the drive, it works fine on a read-only file system. That's how TTSd works.
One of the neat features of unix.
|
Top
|
|
|
|
#139495 - 03/02/2003 12:08
Re: GPSApp suggestion- way to send info to other p
[Re: TheAmigo]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
You still need to create it.
And I still think we can do something better.
|
Top
|
|
|
|
#139496 - 03/02/2003 12:14
Re: GPSApp suggestion- way to send info to other p
[Re: tman]
|
enthusiast
Registered: 14/09/2000
Posts: 363
|
To be a little more clear, a fifo limits you to one external app at a time. If each app just reads from the fifo and closes it, it's available for another to read. Although, I'm not sure if you can tell if another app is trying to read from it so you should wait...
|
Top
|
|
|
|
#139497 - 03/02/2003 12:23
Re: GPSApp suggestion- way to send info to other progs
[Re: tfabris]
|
member
Registered: 30/08/2000
Posts: 157
Loc: London, UK
|
letting you know when you are near a petrol stations / how far to the next one... and if the data is available (as it is in Perth and more generally Australia) what the price at the station is today.
Not sure about a db of lat lons, but should be able to be generated from the street addresses and access to an online map. Once generated for an area could be a useful resource to share with others.
Cheers
Kim
|
Top
|
|
|
|
#139498 - 03/02/2003 12:25
Re: GPSApp suggestion- way to send info to other progs
[Re: kimbotha]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
|
letting you know when you are near a petrol stations / how far to the next one...
Ooo, what would be really good is if one could go by company. I have a Chevron card and prefer to buy my gas at Chevrons for that reason. I'd love to always know where the next Chevron was along my planned route.
|
Top
|
|
|
|
#139499 - 03/02/2003 12:29
Re: GPSApp suggestion- way to send info to other p
[Re: Daria]
|
enthusiast
Registered: 10/09/2002
Posts: 285
Loc: DFW Area, Texas, US
|
Way back in days of old when I used to write QNX apps, we used to use the IPC message sending abilities quite a lot (see here for a quick description).
I had a quick google (as I don't write Linux apps for a living) and came up with the details of the same mechanism in Linux( here).
So I guess that it would be possible for GPSApp (or the backend to it if it ends up being split) creating a message queue with a known key, so it can be found by any app that wanted the info. Each app in turn could also set up its own queue, and and send the details for that to GPSApp when registering in GPSApps queue.
Then whenever GPSApp has some data to send (an update from the receiver), it checks its queue, and adds any new queues to its list, then just cycles through all of the quese it knows about sending them the same data, that way the app writer has the option of only checking the data when it wants, or sitting recv blocked waiting for the latest data.
So, any comments?
_________________________
Mark.
[blue]MKI, MKII & MKIIa, all Blue, and all Mine![/blue]
|
Top
|
|
|
|
#139500 - 03/02/2003 13:33
Re: GPSApp suggestion- way to send info to other p
[Re: siberia37]
|
enthusiast
Registered: 20/08/2002
Posts: 340
Loc: Pittsburgh, PA
|
I was already discussing this with dbrashear in some other thread. Basically gpsapp should at some point be split up in a backend, which very possibly could be gpsd, and possible multiple frontends. Communication could go through a shared memory page, socket, or named pipe.
Things that frontends could do are numerous. Show directions to local restaurants that are still open, especially fun if it isn't a list of mickey d's, but those excellent local places that you'd never know about unless someone told you. Automatically reprogramming the tuner for local radio stations when driving long distances. Public 802.11 access points in the area, to get that daily empeg.comms.net fix while you're on the road.
It would also make it easier to keep gpsapp responsive, a background thread/process could do the map-drawing while the main program just deals with key input and refreshing the display. Similarily we could track progress and pop up directions even while the gpsapp visuals are not active (i.e. when we're in the player app).
The sky is the limit. Although in reality, available programming cycles are probably more the limit
_________________________
40GB - serial #40104051 gpsapp
|
Top
|
|
|
|
#139501 - 03/02/2003 13:44
Re: GPSApp suggestion- way to send info to other p
[Re: jaharkes]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
|
Automatically reprogramming the tuner for local radio stations when driving long distances.
Oh yeah, I'd forgotten about that one. That would rock!
Public 802.11 access points in the area, to get that daily empeg.comms.net fix while you're on the road.
Ah, the empeg equivalent of warchalking. COOL.
|
Top
|
|
|
|
#139502 - 03/02/2003 13:46
Re: GPSApp suggestion- way to send info to other p
[Re: tfabris]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
Ah, the empeg equivalent of warchalking. COOL.
And, thus, the term "warpegging" was born.
|
Top
|
|
|
|
#139503 - 03/02/2003 14:26
Re: GPSApp suggestion- way to send info to other p
[Re: tfabris]
|
old hand
Registered: 09/01/2002
Posts: 702
Loc: Tacoma,WA
|
Delorme Street Atlas has information on local radio stations and restuarants, gas stations, etc.. The restaurants and rest stops could be exported and transformed to another format via parsing the output of a Garmin GPS emulator I found. (i.e. SA will not export routes to a text file usuably but it will export them to a Garmin GPS).
Radio stations I dunno about.. more details on this as I look into it more.
|
Top
|
|
|
|
#139504 - 03/02/2003 17:06
Re: GPSApp suggestion- way to send info to other p
[Re: TheAmigo]
|
carpal tunnel
Registered: 24/12/2001
Posts: 5528
|
Yeah. That would work. You'd have to make sure all of the programs behaved and would close the fifo when it's not needed. I'm also not sure how you'd know that somebody else is reading the fifo.
The problem with the fifo is that you'd need to make sure that the fifo is being read at the same or faster rate than it's being written to by the gps daemon. Otherwise you're going to end up with stale data. *shrug*
- Trevor
|
Top
|
|
|
|
#139505 - 03/02/2003 17:40
Re: GPSApp suggestion- way to send info to other p
[Re: tonyc]
|
enthusiast
Registered: 14/09/2000
Posts: 363
|
And, thus, the term "warpegging" was born.
That spelling leads me to think of two pronounciactions. The one I'm sure you were going for is "war-pegging", while the other sounds like something the Ferengi might do to the Enterprise: "Warp-egging".
|
Top
|
|
|
|
#139506 - 03/02/2003 17:44
Re: GPSApp suggestion- way to send info to other p
[Re: TheAmigo]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
|
Anyone remember the game "Stellar 7" from back in the C-64 days? You ended each level by flying into a warplink. My friend never understood what a war-plink was...
|
Top
|
|
|
|
#139507 - 03/02/2003 19:23
Re: GPSApp suggestion- way to send info to other p
[Re: Chimaera]
|
carpal tunnel
Registered: 24/12/2001
Posts: 5528
|
The stock empeg kernel doesn't actually have SysV IPC compiled in. We'd need to convince Mark to turn it on for his Hijack kernel. This is assuming the user wants the Hijack kernel...
- Trevor
|
Top
|
|
|
|
#139508 - 03/02/2003 20:19
Re: GPSApp suggestion- way to send info to other p
[Re: tman]
|
carpal tunnel
Registered: 29/08/2000
Posts: 14496
Loc: Canada
|
For less than the bloat (small) involved in SYSV IPC, we could just have Hijack capture the NMEA strings and make them globally available under /proc/
No complex messaging or shared memory required. Just open /proc/nmea and read the most recent NMEA strings.
Or we could also have Hijack parse the strings, and just save the timestamp and position info for /proc/, so that each induhvidual app doesn't have to learn NMEA as well.
Hijack accepts patches..
-ml
|
Top
|
|
|
|
#139509 - 03/02/2003 22:48
Re: GPSApp suggestion- way to send info to other p
[Re: mlord]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
Not all GPS is NMEA though, so it's not as simple as that.
|
Top
|
|
|
|
#139510 - 04/02/2003 07:07
Re: GPSApp suggestion- way to send info to other p
[Re: Daria]
|
carpal tunnel
Registered: 29/08/2000
Posts: 14496
Loc: Canada
|
Okay, all those in the room using a non-NMEA capable GPS with GPSapp today please raise your hands.. Not theoretically, but actually doing it today, with the GPSr normally used for that purpose? Anyone?
-ml
|
Top
|
|
|
|
#139511 - 04/02/2003 11:15
Re: GPSApp suggestion- way to send info to other p
[Re: mlord]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
Hi.
Also, anyone using an Earthmate, put your hand up now.
|
Top
|
|
|
|
#139513 - 04/02/2003 12:12
Re: GPSApp suggestion- way to send info to other p
[Re: mlord]
|
enthusiast
Registered: 20/08/2002
Posts: 340
Loc: Pittsburgh, PA
|
Raising my hand. My trimble uses TSIP.
Also we're not just interested in postition, but also server signal strength, speed, quality of the location estimate, direction of travel. Some applications are more likely to work in a polling fashion while others might want to get notified as soon as updates are available. And then this information comes in different messages. It is important to know that the last position update was 10 minutes ago, but that we've seen a satellite in the past 2 seconds.
There are also different rules about when the information is good enough to use for instance to sync your local clock. And those rules do vary slighly on a per-gps basis. Also gps receivers don't supply all information all of the time, or only provide speed in knots instead of m/s, and somewhere a decision needs to be made which measurement to use. For instance on the trimbles, I'm getting notified of location updates as long as there is a 'fix', but have to poll the receiver for satellite information and to discover that we lost our lock and we're not getting realistic location information.
_________________________
40GB - serial #40104051 gpsapp
|
Top
|
|
|
|
#139514 - 04/02/2003 12:15
Re: GPSApp suggestion- way to send info to other p
[Re: jaharkes]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
In defence of Mark's scheme, you could cache the last received sentence of each type (or in the case of sentences where you get e.g. 3 of them to get all of the info they provide, all 3 of them) and a timestamp, and still have all the information you do now. It doesn't address polling versus notified.
|
Top
|
|
|
|
#139515 - 04/02/2003 12:33
Re: GPSApp suggestion- way to send info to other p
[Re: Daria]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
I'd think it would make more sense to have a daemon application that listened to the GPS and to which applications could connect over a socket. The daemon could send all immediate data to each application connected to it and respond to any directed queries. At its most basic level, it could essentially just multiplex the data to each connected socket, but that doesn't address multiple initializations, etc.
Regardless, the basic issue is multiplexing the data. It would seem to make sense not to recitify the data too soon. You also need some way to contend with multiple writers, especially when the write changes the GPS in some way, but even when querying for certain information and providing that data back to the correct client, and not to others.
(Note that I know fairly little about GPS, so some of my assumptions could be wrong.)
_________________________
Bitt Faulk
|
Top
|
|
|
|
#139516 - 04/02/2003 12:36
Re: GPSApp suggestion- way to send info to other p
[Re: wfaulk]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
Regardless, the basic issue is multiplexing the data. It would seem to make sense not to recitify the data too soon. You also need some way to contend with multiple writers, especially when the write changes the GPS in some way, but even when querying for certain information and providing that data back to the correct client, and not to others.
If you're passing a query through to the gps receiver, the response can be received by all receivers safely. Those which don't want to use that data can just ignore it. If it's a sentence they parse, they use it, otherwise they don't. No harm, no foul.
|
Top
|
|
|
|
#139517 - 04/02/2003 12:36
Re: GPSApp suggestion- way to send info to other p
[Re: Daria]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
Wrong assumption #1.
Of course, you still have to deal with not letting one client change the device's functions on top of another. Maybe just a filter for such strings and let the daemon do the init, with a suggestion to the clients to not try inits and define the way that the daemon will set it up.
_________________________
Bitt Faulk
|
Top
|
|
|
|
#139518 - 04/02/2003 12:54
Re: GPSApp suggestion- way to send info to other p
[Re: wfaulk]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
Most things you can do to change a GPS receiver are harmless. The ones that might matter that I can think of are changing whether you cold start and making sentences come in less frequently or not at all (for receivers that support configuring what and when you get sentences)
You could simply filter all proprietary sentences but some of them are useful. Making a "blacklist" would work but could get messy, since it means we need to know what every proprietary sentence *is*.
|
Top
|
|
|
|
#139519 - 04/02/2003 13:02
Re: GPSApp suggestion- way to send info to other p
[Re: jaharkes]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
How about an ioctl() interface in Hijack which lets user apps (in this case, GPSapp) register a /proc entry and another ioctl() for them to publish information to that /proc entry. Then Hijack stays out of the business of parsing NMEA/TSIP/whatever.
So gpsapp would do its normal parsing of whatever GPS data is there, and register a proc entry with something like
char szProcFilename[16] = "empeg_gps"
char szGpsBuffer[4096];
rc = ioctl(fd, EMPEG_HIJACK_PROCREGISTER, &szProcFilename);
// parse GPS data, put it into text buffer szGpsBuffer
rc = ioctl(fd, EMPEG_HIJACK_PROCPUBLISH, &szGpsBuffer);
.
Then any app can put an entry in /proc, and any other apps can go and read that data. Worthwhile or no?
|
Top
|
|
|
|
#139520 - 04/02/2003 15:19
Re: GPSApp suggestion- way to send info to other p
[Re: Daria]
|
member
Registered: 30/08/2000
Posts: 157
Loc: London, UK
|
I have the older gpsTripMate... but then I haven't actually plugged it in recently...
Cheers
Kim
|
Top
|
|
|
|
#139521 - 04/02/2003 15:28
Re: GPSApp suggestion- way to send info to other p
[Re: kimbotha]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
The Tripmate will do NMEA, it just needs you to send the "ASTRAL" init string at it.
|
Top
|
|
|
|
#139522 - 04/02/2003 16:06
Re: GPSApp suggestion- way to send info to other p
[Re: Daria]
|
carpal tunnel
Registered: 19/01/2002
Posts: 3584
Loc: Columbus, OH
|
Instructions for fixing that are here or here.
_________________________
~ John
|
Top
|
|
|
|
#139523 - 04/02/2003 16:06
Re: GPSApp suggestion- way to send info to other p
[Re: wfaulk]
|
old hand
Registered: 09/01/2002
Posts: 702
Loc: Tacoma,WA
|
Has someone already looked into compiling gpsd and using it? Seems like a decent little daemon for this purpose...
|
Top
|
|
|
|
#139524 - 04/02/2003 16:13
Re: GPSApp suggestion- way to send info to other p
[Re: siberia37]
|
carpal tunnel
Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
|
Search the bbs for gpsd. Better yet, read the changelog in the directory you provided the link to.
|
Top
|
|
|
|
#139525 - 04/02/2003 16:22
Re: GPSApp suggestion- way to send info to other p
[Re: Daria]
|
old hand
Registered: 09/01/2002
Posts: 702
Loc: Tacoma,WA
|
oops sorry about that it appears people have checked it out more than i know..
|
Top
|
|
|
|
#139526 - 11/02/2003 13:07
Re: GPSApp suggestion- way to send info to other p
[Re: tman]
|
veteran
Registered: 21/01/2002
Posts: 1380
Loc: Erie, CO
|
In reply to:
Yeah. That would work. You'd have to make sure all of the programs behaved and would close the fifo when it's not needed. I'm also not sure how you'd know that somebody else is reading the fifo.
The problem with the fifo is that you'd need to make sure that the fifo is being read at the same or faster rate than it's being written to by the gps daemon. Otherwise you're going to end up with stale data. *shrug*
I'm just learning about fifo's but I've read when you open a fifo for writing, and that fifo is not opened for reading, then the open command returns an error. Is this correct on the empeg, too?
|
Top
|
|
|
|
|
|