Page 1 of 2
Get GPS & Navigation Info from Mapfactor Navigator 14 TCP - how difficult?
Posted: Wed May 13, 2015 6:55 am
by TonyG
Hi Folks,
Housebot is proving to be a great tool for providing the UI for my campervan PC system. Housebot (with Girder) is controlling: Navigation, Rear View Camera, and Music using the new Housebot JSON RPC Kodi.dll (currently in Beta).
The Kodi plugin has opened my eyes to the versatility and power of Housebot.
Display in Housebot
I would love to display some data from my turn-by-turn Navigation app. The main ones are:
1) Altitude
2) Distance / time to destination
3) Distance / time to next turn
Mapfactor Navigator 14 with TCP/IP built-in - Promising??
"Navigator can integrate with other programs with a number of external commands. These can be sent to Navigator via a serial interface or TCP / IP. .... You can also obtain information from Navigator, f.e. remaining time or distance to destination, current coordinates, and others."
More here: http://kb.mapfactor.com/kb/N ... teCommands
This would use the following mapfactor TCP commands;
1) Altitude - use 1.9. GET LAST KNOWN GPS POSITION
(1.9.6. Return values when last position is known: latitude(degrees),longitude(degrees),altitude(meters),speed(km/h),course(degrees))
2) Distance / time to destination - use 1.6. NAVIGATION ROUTE STATISTICS
3) Distance / time to next turn - use 1.6. NAVIGATION ROUTE STATISTICS
(1.6.2. Description returns distance (in meters) or time (in seconds) to destination and nearest waypoint
1.6.4. Availability: tcp/ip or com
1.6.6. Return values: distance to waypoint, time to waypoint, distance to destination, time to destination
example: 1000,60,2000,122
How to?
So, this is where I get unstuck. I can imagine a simple plugin which exposes these values in a similar way to other Housebot plugins I've used (Kodi, Sonos) - but no expertise in software or writing a .dll for Housebot.
If anyone could make this happen, there would be some reasonable "beer money" through paypal as a gesture..
Thanks,
Tony
Re: Get GPS & Navigation Info from Mapfactor Navigator 14 TCP - how difficult?
Posted: Thu May 14, 2015 3:02 pm
by ScottBot
Tony,
When you say tcp/ip or COM does COM mean that there is an RS232 port that you can also use? If so, then you should be able to use the existing generic serial plugin.
If you need a Device that listens on a tcp socket, then it will be a little more work.
Re: Get GPS & Navigation Info from Mapfactor Navigator 14 TCP - how difficult?
Posted: Fri May 15, 2015 4:15 am
by TonyG
Hi Scott,
I've looked into the Com port option. Everything is on the same PC and as such I'm looking to avoid hardware such as RS-232 ports on USB. I've tried virtual com ports before, but the TCP option would I think be the most robust.
Is TCP going to be "a lot of beers"?
Cheers,
Tony
Re: Get GPS & Navigation Info from Mapfactor Navigator 14 TCP - how difficult?
Posted: Fri May 15, 2015 9:03 am
by ScottBot
I have a UDP Device that is similar to what you need. I might be able to convert it to TCP without too many beers.
Re: Get GPS & Navigation Info from Mapfactor Navigator 14 TCP - how difficult?
Posted: Fri May 15, 2015 3:25 pm
by TonyG
Thanks Scott,
There's a free version of Mapfactor Navigator, which also uses the same base program (just free maps), and employs the same TCP features.
The free version is here:
http://navigatorfree.mapfactor.com/en/
And the supporting text:
http://kb.mapfactor.com/kb/Navigator/RemoteCommands
Fingers crossed...
Tony
Re: Get GPS & Navigation Info from Mapfactor Navigator 14 TCP - how difficult?
Posted: Fri May 15, 2015 6:19 pm
by ScottBot
I'll check out the free version when I get closer to having something. It might be a few weeks before I get a chance to look into it.
Re: Get GPS & Navigation Info from Mapfactor Navigator 14 TCP - how difficult?
Posted: Sat May 16, 2015 2:58 am
by edgar
Hi Guys,
Would Osler's TCP Client plugin work? I have actually used it before and it works well. Osler had the source code posted here too. I actually did a recompile on it to tweak it for a robot application I was working on. It might serve as a starting point for development.
Best of luck on development!
v/r
Kevin
Re: Get GPS & Navigation Info from Mapfactor Navigator 14 TCP - how difficult?
Posted: Sat May 16, 2015 5:10 am
by TonyG
Thanks Both,
Osler hey? - I remember the Sonos plugin he wrote. Fantastic stuff.
I feel I'm always asking, but I think it's down to the affect this solution has on you when you start to realise its possibilities - you don't know when to stop!
There's a bunch of people using custom "front ends" for Car PCs, and over the years I've downloaded many. They all suffer in terms of quality. Housebot (with Girder doing some stuff in the background) offers a far better solution in terms of quality, versatility, and the immediacy of setting out the user interface.
Re: Get GPS & Navigation Info from Mapfactor Navigator 14 TCP - how difficult?
Posted: Sat May 16, 2015 8:50 am
by ScottBot
edgar wrote:Would Osler's TCP Client plugin work? ...
Looking quickly at it, it looks pretty much the same thing I was thinking of doing. So it would probably work well.
If it works for you, let me know. Otherwise I'll take a shot at it in a week or so.
Re: Get GPS & Navigation Info from Mapfactor Navigator 14 TCP - how difficult?
Posted: Thu Mar 24, 2016 7:10 am
by TonyG
Having had success using the external control HTTP feature in 3.31, I thought I would progress another "long-termer" - and have a look at getting information from Mapfactor Navigator TCP.
I've set Navigator (free edition
http://navigatorfree.mapfactor.com/en/) "remote communication device" to "127.0.0.1", on port "8002".
Tested using Putty in a Telnet session, issuing the following requests, and successfully getting the following returns
$navigation_statistics
4294967295,4294967,4294967295,4294967
(distance to waypoint, time to waypoint, distance to destination, time to destination)
$last_position
51.334012,-2.823696,21,1,114
(atitude(degrees),longitude(degrees),altitude(meters),speed(km/h),course(degrees))
I can also set day and night time modes using:
$set_mode=day
$set_mode=night
I've tried to progress this using Oslers TCP plugin (I already use HBDotNetBridge.dll and HBDotNet.dll) for Allans weather plugin. Not getting anything back, and it doesn't seem to like 127.0.0.1 (TCP plugin fails on startup) - which works with Putty, and everything is local.
If anyone is up for a challenge, I'm at the stage where this is going to be very useful. Any help, pointers etc - very much appreciated.
Re: Get GPS & Navigation Info from Mapfactor Navigator 14 TCP - how difficult?
Posted: Thu Mar 24, 2016 7:49 am
by ScottBot
So the failure is when you are making the requests with the Navigator app? If that's the case and you are not on your local wifi network (ie. going through the cell network), the 127.0.0.1 address won't work. If that is the issue, I can give you a couple of alternatives.
Re: Get GPS & Navigation Info from Mapfactor Navigator 14 TCP - how difficult?
Posted: Fri Mar 25, 2016 5:22 pm
by TonyG
Hi Scott,
Bit out of my comfort zone here, but it looks like the TCP plugin just doesn't like 127.0.0.1 as an address?
I get "TCP Socket Error - An address incompatible with the requested protocol was used". I've temporarily disabled the ExternalControl.dll, and WorldWeatherOnline.dll plugins. And checked all actions several times.
At this stage, I would like to know if anyone else has this plugin working on 127.0.0.1 - I would prefer to keep things simple with a localhost address.
Re: Get GPS & Navigation Info from Mapfactor Navigator 14 TCP - how difficult?
Posted: Sat Mar 26, 2016 5:12 am
by TonyG
Away from the question of 127.0.0.1 local-host, I have used the system IP and port 8001 for further testing.
First, tested using a telnet session in Putty - all good with response from Mapfactor Navigator.
In Housebot:
TCConnected=1
TCHostAddress=192.168.1.82
TCHostPort=8001
TCSendData=$last_position
Here's the log-file from sending $last_position:
Attempting connection to 192.168.1.82:8001.
Connection established.
Calling Device Run on Device [TCP Client] [TCP for Mapfactor]
TCSendData changed to $last_position
"Sending data ($last_position)."
[TCP for Mapfactor.TCSendData] has changed to [$last_position]
[TCP for Mapfactor.TCSendData] has changed to []
Data sent.
No response printed in TCReceivedData.
Is the data being sent?
I've tried sending: $chat="message" - and the message box of mapfactor navigator is empty - I'm not sure if the data is really being sent. Any way to test?
EDIT: It looks like a connection
is made, based on reverse logic - if I open Housebot without Mapfactor Navigator, HB reports an error. And as you can see, with Mapfactor Navigator open, HB reports "connection established" in the log.
If this rings a bell with anyone please let me know - otherwise I'll keep on trying!
Re: Get GPS & Navigation Info from Mapfactor Navigator 14 TCP - how difficult?
Posted: Mon Apr 04, 2016 6:05 am
by TonyG
Update on my quest..
TCP Plugin appears to send data, but nothing back on "TCReceivedData". No return on device log.
I've discovered this on the Housebot tracelog: (with port 8001 set up in Housebot and Mapfactor Navigator)
TCP Server Debug 'Listening' on port 5015
TCP Server Debug IPC Server is ready and waiting for connections.
Does the TCP Plugin listen on a fixed port - 5015?
A quick change of the mapfactor "remote communicator device" to port 5015 with the following test command: $software_version sent from Housebot:
1) Still nothing returned on "TCReceivedData"
2) But I'm now getting a return on the Housebot tracelog:
'Listening' on port 5015
IPC Server is ready and waiting for connections.
Accepted client connection from 192.168.1.82. New connection ID = 1
Received datagram from 192.168.1.82
Data Received 18 bytes. [24 73 6f 66 74 77 61 72 65 5f 76 65 72 73 69 6f 6e 0d] (using a hex to ascii converter this message is " $software_version"
$software_version is the command I'm sending from Housebot NOT the response from Mapfactor (which always works in Putty).
Not working yet, and I'm unclear of the use of port 5015 - is this right for receiving data back when I'm using a different port for the connection?
Re: Get GPS & Navigation Info from Mapfactor Navigator 14 TCP - how difficult?
Posted: Mon Apr 04, 2016 9:31 am
by ScottBot
I think what you are seeing is the TCP server for the SW Remote. It's listening on 5015 also.
I'd suggest playing with the port settings for the port you are using for the Mapfactor port. It's very possible that the HB plugin is using a different speed, parity, flow control, etc. than PuTTY.