<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div>The DIAG port is a tap on the async comms between the PIC and the MODEM.<div><br></div><div>During INIT, the PIC uses ATE0 to disable echo. This is necessary because if we receive SMS commands or GPRS data while transmitting a command (with echo on), things get confused - by turning echo off for production we don't get any such problems.</div><div><br></div><div>I really wish the SIMCOM modem had a 'print' style AT command - something to just print out what it is given, but I can't find any such facility.</div><div><br></div><div>The approach you use, for development, is fine.</div><div><br></div><div>An alternative is to extend the SETUP mode in the code (see diag.c) to give you a similar facility. That can run with ATE1 no problem, as no modem comms are used.</div><div><br></div><div>To get the module into SETUP mode, the following video should help:</div><div><br></div><div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><a href="http://www.youtube.com/watch?v=-24PoWtHVzk">http://www.youtube.com/watch?v=-24PoWtHVzk</a></div></blockquote></div><div><br></div><div>Regards, Mark.</div><div><br><div><div>On 3 Nov, 2012, at 3:35 AM, Michael Balzer <<a href="mailto:dexter@expeedo.de">dexter@expeedo.de</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">I wanted to get some direct debug logging. It took me some time to figure out the diag port only echoes what is sent from the SIM908 to the PIC18, I first thought it tapped RX+TX so I could see the complete communication.<br><br>Next problem was the modem switches echos off (after COPS I think), so I need to re-enable them at least once in a while.<br><br>I'm now using this scheme in can_state_ticker1():<br><br>#ifdef OVMS_DEBUG<br> // CAN debug log via DIAG port SIM908 command echo:<br> // ATT: could be a problem for running data transfers,<br> // should not be enabled for production/live firmware images!<br> net_puts_rom( "ATE1\r" );<br> sprintf( net_scratchpad,<br> (rom far char*) "# ERR=%u SOC=%u RNG=%u SPD=%d PWR=%d CHG=%u\r",<br> RXERRCNT, can_soc, can_range, can_speed, can_power, car_chargestate );<br> net_puts_ram( net_scratchpad );<br>#endif<br><br>My questions: am I right with the suspected problem, and is there a better way?<br><br>Regards,<br>Michael<br><br>-- <br>Michael Balzer * Paradestr. 8 * D-42107 Wuppertal<br>Fon 0202 / 272 2201 * Handy 0176 / 206 989 26<br><br><span><dexter.vcf></span>_______________________________________________<br>OvmsDev mailing list<br><a href="mailto:OvmsDev@lists.teslaclub.hk">OvmsDev@lists.teslaclub.hk</a><br>http://lists.teslaclub.hk/mailman/listinfo/ovmsdev<br></blockquote></div><br></div></body></html>