[Ovmsdev] GPS / NMEA integration

Michael Balzer dexter at expeedo.de
Wed Dec 13 02:56:21 HKT 2017


Am 11.12.2017 um 06:47 schrieb Mark Webb-Johnson:
> Under the principle of ‘keep everything powered off unless explicitely asked to power it on’, I think we should default enable.gps and enable.gpstime to FALSE.
>
> Thinking about the arrangement of a vehicle requiring GPS, perhaps this can be signalled somehow in vehicle.{h,cpp}? Have the vehicle module define there that
> it requires modem GPS and/or GPSTIME, and then have the nmea module enable appropriately? We can still retain modem/enable.gps(time) for explicitly enabling
> (I had a use case for this when a roadster owner on v2 had a broken car GPS, but the v2 tesla_roadster module doesn't enable the modem gps).
>
> So the logic in nmea becomes: If ((vehicle module needs modem GPS)||(modem enable.gps)) Then enable gps.
>

The SIMCOM module now listens to these events:

  * vehicle.require.gps
  * vehicle.release.gps
  * vehicle.require.gpstime
  * vehicle.release.gpstime

If a vehicle needs GPS provided by the system, it does for example:

    MyEvents.SignalEvent("vehicle.require.gps", NULL);
    MyEvents.SignalEvent("vehicle.require.gpstime", NULL);

The SIMCOM module will in turn automatically power on and start the GPS subsystem as necessary, regardless of the "enable.gps" config. The signal normally will
be added to the vehicle init but can be sent any time. The release signals can be used to shutdown the service when it's no longer needed.

The "simcom status" command shows both enabled & required status.

OVMS > simcom status
SIMCOM
  Network Registration: NotRegistered
  State: PoweredOff
  Ticker: 3
  User Data: 0
  Mux Open Channels: 0
  PPP Not Connected
  PPP Last Error: Undefined
  GPS: *disabled*
  GPS time: disabled
  NMEA (GPS/GLONASS) Not Connected

OVMS > vehicle module RT
I (46062) v-renaulttwizy: Renault Twizy vehicle module
I (46062) events: Signal(power.can1.on)
I (46072) v-renaulttwizy: battmon subsystem init
I (46072) v-renaulttwizy: pwrmon subsystem init
I (46082) events: Signal(*vehicle.require.gps*)
I (46082) events: Signal(power.simcom.on)
I (46082) simcom: State: Enter PoweringOn state
I (46082) simcom: Power Cycle
I (46562) events: Signal(vehicle.charge.mode)
I (46562) events: Signal(vehicle.charge.state)
I (47082) events: Signal(vehicle.require.gpstime)
I (52562) simcom: State: Enter PoweredOn state
I (72572) simcom: State: Enter MuxStart state
I (72572) gsm-mux: Start MUX
I (72572) gsm-mux: StartChannel(0)
I (72572) gsm-mux: Channel #0 is open
I (72572) gsm-mux: StartChannel(1)
I (72582) gsm-mux: Channel #1 is open
I (72582) gsm-mux: StartChannel(2)
I (72592) gsm-mux: Channel #2 is open
I (72592) gsm-mux: StartChannel(3)
I (72602) gsm-mux: Channel #3 is open
I (72602) gsm-mux: StartChannel(4)
I (72612) gsm-mux: Channel #4 is open
I (73562) simcom: State: Enter NetWait state
I (73562) gsm-nmea: Startup
I (80182) events: Signal(*gps.lock.acquired*)
I (80192) notify: Raise text data: RT-GPS-Log,0,86400,51.30230713,7.38993549,332,0,0,1,120,-97,0,0,0,0,0,0,40,0,0,1.000,1.000,0,0
I (80192) events: Signal(system.modem.gotgps)

OVMS > simcom status
SIMCOM
  Network Registration: RegisteredRoaming
  State: NetMode
  Ticker: 107
  User Data: 0
  Mux Open Channels: 4
  PPP Connected on channel: #2
  PPP Last Error: None
  GPS: disabled, *required*
  GPS time: disabled, required
  NMEA (GPS/GLONASS) Connected on channel: #1


Regards,
Michael


> Regards, Mark.
>
>> On 10 Dec 2017, at 10:33 PM, Michael Balzer <dexter at expeedo.de <mailto:dexter at expeedo.de>> wrote:
>>
>> Works, pushed:
>>
>> OVMS > config list modem
>> modem
>>   apn: hologram
>>   apn.password:
>>   apn.user:
>> *  enable.gps: yes**
>> **  enable.gpstime: yes*
>>   enable.net <http://enable.net>: yes
>>   enable.sms: yes
>>
>> OVMS > power simcom on
>> Power mode of simcom is now on
>> I (28084) events: Signal(power.simcom.on)
>> I (28084) simcom: State: Enter PoweringOn state
>> I (28084) simcom: Power Cycle
>> I (34414) simcom: State: Enter PoweredOn state
>> I (53514) simcom: State: Enter MuxMode state
>> I (53514) gsm-mux: Start MUX
>> I (53514) gsm-mux: StartChannel(0)
>> I (53524) gsm-mux: Channel #0 is open
>> I (53524) gsm-mux: StartChannel(1)
>> I (53534) gsm-mux: Channel #1 is open
>> I (53534) gsm-mux: StartChannel(2)
>> I (53544) gsm-mux: Channel #2 is open
>> I (53544) gsm-mux: StartChannel(3)
>> I (53544) gsm-mux: Channel #3 is open
>> I (53544) gsm-mux: StartChannel(4)
>> I (53554) gsm-mux: Channel #4 is open
>> I (54514) simcom: State: Enter NetStart state
>> I (54514) gsm-nmea: Startup
>> *I (62414) events: Signal(system.modem.gotgps)*
>>
>> OVMS > metrics list utc
>> m.time.utc                               1512915059Sec
>>
>> OVMS > metrics list .p.
>> v.p.altitude                             346m
>> v.p.direction                            341.2°
>> v.p.gpshdop                              1
>> v.p.gpslock                              yes
>> v.p.gpsmode                              AA
>> v.p.gpsspeed                             0Kph
>> v.p.latitude                             51.3023
>> v.p.longitude                            7.39013
>> v.p.odometer                           
>> v.p.satcount                             11
>> v.p.speed                              
>> v.p.trip                               
>>
>> OVMS > power simcom sleep
>> Power mode of simcom is now sleep
>> I (103104) events: Signal(power.simcom.sleep)
>> I (103514) simcom: State: Enter NetSleep state
>> I (103514) gsm-ppp: Shutting down (soft)...
>> I (103514) gsm-nmea: Shutdown (direct)
>> *I (103514) events: Signal(system.modem.lostgps)*
>>
>> OVMS > power simcom on
>> Power mode of simcom is now on
>> I (154494) events: Signal(power.simcom.on)
>> I (154514) simcom: State: Enter NetStart state
>> I (154514) gsm-nmea: Startup
>> *I (159414) events: Signal(system.modem.gotgps)*
>> I (160544) simcom: PPP Connection is ready to start
>> I (161514) simcom: State: Enter NetMode state
>> I (161514) gsm-ppp: Startup
>>
>>
>> I've changed direction & altitude to float, missed those on the previous rework.
>>
>> I've removed setting "m.time.utc" from the Twizy and Kia modules. On the Roadster, set "enable.gpstime" to "no".
>>
>> I'm getting around 10 satellites all the time with my GSM antenna and our currently very snowy weather, so it seems we don't need active GPS antennas with
>> this module. But I haven't had it on the road yet.
>>
>> Regards,
>> Michael
>>
>>
>> Am 10.12.2017 um 09:23 schrieb Michael Balzer:
>>> Toms comment made me test my GSM antenna, lo and behold, it works:
>>>
>>> D (298314) gsm-nmea: IncomingLine: $GPGSV,2,1,06,01,,,31,08,26,174,30,14,45,082,37,19,01,323,23*42
>>> D (298314) gsm-nmea: IncomingLine: $GPGSV,2,2,06,22,68,234,25,32,,,35*44
>>> D (298324) gsm-nmea: IncomingLine: $GLGSV,2,1,06,66,19,039,43,82,56,144,38,75,11,007,34,81,07,142,16*6A
>>> D (298334) gsm-nmea: IncomingLine: $GLGSV,2,2,06,67,73,053,46,68,45,213,31*6F
>>> D (298334) gsm-nmea: IncomingLine: $GPGGA,080552.0,5118.139329,N,00723.395918,E,1,02,2.1,316.7,M,47.0,M,,*50
>>> D (298344) gsm-nmea: IncomingLine: $GNGNS,080552.0,5118.139329,N,00723.395918,E,AA,06,2.1,316.7,47.0,,*60
>>> D (298344) gsm-nmea: IncomingLine: $GPVTG,,T,0.0,M,0.0,N,0.0,K,A*0D
>>> D (298354) gsm-nmea: IncomingLine: $GPRMC,080552.0,A,5118.139329,N,00723.395918,E,0.0,,101217,,,A*49
>>> D (298354) gsm-nmea: IncomingLine: $GPGSA,A,2,08,14,,,,,,,,,,,2.3,2.1,0.9*35
>>> D (298364) gsm-nmea: IncomingLine: $GNGSA,A,2,08,14,,,,,,,,,,,2.3,2.1,0.9*2B
>>> D (298364) gsm-nmea: IncomingLine: $GNGSA,A,2,66,67,75,82,,,,,,,,,2.3,2.1,0.9*2F
>>>
>>>
>>> My GPS antenna is an active one for V2, it seems the current module does not support active antennas.
>>>
>>> Actice GPS antennas are the standard choice over here. If the SIM5360 can do without, that will eliminate another energy drain, so is good. Users will need
>>> to know they'll need another antenna.
>>>
>>> Regards,
>>> Michael
>>
>> -- 
>> Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
>> Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
>> _______________________________________________
>> OvmsDev mailing list
>> OvmsDev at lists.teslaclub.hk <mailto:OvmsDev at lists.teslaclub.hk>
>> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
>
>
>
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.teslaclub.hk
> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev

-- 
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20171212/b2a32fbe/attachment.htm>


More information about the OvmsDev mailing list