Page 1 of 2

Issues sending data via HTTP(s) using Freematics telelogger

Posted: Sun Jul 12, 2020 6:15 pm
by daveywatt
I've been trying to get a simple HTTP post event sent from a FreematicsPlus device.

Sending via UDP is fine, but as soon as I set #define SERVER_PROTOCOL PROTOCOL_HTTPS I get the following errors and an infinite reboot.

I have not changed any other code, other than setting #define SERVER_HOST to my own server endpoint which is simply logging all request received to a file.

Once #define SERVER_PROTOCOL PROTOCOL_HTTPS as been set, the following is output in the console:

Code: Select all

GNSS:OK
OBD:NO
WiFiGuru Meditation Error: Core  1 panic'ed (InstrFetchProhibited). Exception was unhandled.
Core 1 register dump:
PC      : 0x3f4025ea  PS      : 0x00060c30  A0      : 0x800d6aa9  A1      : 0x3ffb3db0  
A2      : 0x3ffc1284  A3      : 0x00000014  A4      : 0x3ffc1284  A5      : 0x00000000  
A6      : 0x3ffc1284  A7      : 0x00000009  A8      : 0x8015409d  A9      : 0x3ffb3d80  
A10     : 0x3ffc1284  A11     : 0x3ffb3dbf  A12     : 0x00000001  A13     : 0x0000df80  
A14     : 0x3ffc39a4  A15     : 0x3ffc39b8  SAR     : 0x0000000a  EXCCAUSE: 0x00000014  
EXCVADDR: 0x3f4025e8  LBEG    : 0x4000c2e0  LEND    : 0x4000c2f6  LCOUNT  : 0xffffffff  

Backtrace: 0x3f4025ea:0x3ffb3db0 0x400d6aa6:0x3ffb3de0 0x400d165b:0x3ffb3e10 0x400d1a53:0x3ffb3f50 0x400d27d9:0x3ffb3f70 0x4008ce91:0x3ffb3fe0

Rebooting...
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:8896
load:0x40080400,len:5828
entry 0x400806ac
E (132) spiram: SPI RAM not initialized
E (132) esp_himem: Cannot allocate memory for meta info. Not initializing!

Any help would be appreciated.

Re: Issues sending data via HTTP(s) using Freematics telelogger

Posted: Mon Jul 13, 2020 10:50 pm
by daveywatt
I can confirm that any HTTP requests seem to fail..

Here is the output from a Freematics One + with the sim7600test.ino software:

Code: Select all

SIM7600E OK
IMEI:XXXXXXXXXXX
SIM Card OK
Registering on network...OK
Operator:Telstra #StaySafe Telstra
Obtaining IP address...10.147.174.51
Init HTTPS stack...NO
Connecting...
+CHTTPSOPSE:0

failed
Connecting...
+CHTTPSOPSE:0

failed
Connecting...
+CHTTPSOPSE:0

failed
Connecting...
+CHTTPSOPSE:0
Any word from the developers on this? Could there be an issue with the SIM module on my hardware?

Re: Issues sending data via HTTP(s) using Freematics telelogger

Posted: Mon Jul 13, 2020 10:55 pm
by daveywatt
Here is the output from sim5360test.ino.

Same issue it seems.

Its worth noting that I have attempted this connect/send on both the hub.freematics.com:443 endpoint and my own server running HTTPS.

Code: Select all

SIM7600E OK
IMEI:XXXXXXXXXXX
SIM Card OK
Registering on network...OK
Operator:Telstra #StaySafe Telstra
Obtaining IP address...10.140.140.178
Init HTTPS stack...OK
Connecting...OK
Sending request...failed
Connecting...OK
Sending request...failed
Connecting...OK
Sending request...failed

Re: Issues sending data via HTTP(s) using Freematics telelogger

Posted: Tue Jul 14, 2020 8:06 pm
by stanley
If you power from USB only instead of from OBD port, there is chance your computer's USB port can't supply enough current surge needed by cellular module.

Re: Issues sending data via HTTP(s) using Freematics telelogger

Posted: Tue Jul 14, 2020 8:35 pm
by daveywatt
Thanks. Is there a pin diagram available so I can supply 12v power while still testing via USB?

Re: Issues sending data via HTTP(s) using Freematics telelogger

Posted: Wed Jul 15, 2020 9:51 am
by daveywatt
I have attempted this on a 5v/2A output and via a car OBD2 port.

If it helps, the cell connection works fine on stock telelogger.ino software with cell APN set to "telstra.iph" (Telstra SIM) and sim pin specified with PROTOCOL_UDP set.
This is to hub.freematics.com. The hub confirms my connection (showing 1m parked).

As soon as I set the config to PROTOCOL_HTTPS, it fails to connect.

Re: Issues sending data via HTTP(s) using Freematics telelogger

Posted: Thu Jul 16, 2020 12:30 pm
by daveywatt
Confirming this is still not working.

I suspect either an issue with the Freematics software or I have a SIM module hardware issue.
I have tried the following steps, both via a USB-C to MicroUSB serial connection that is supplies up to 2A power and via two seperate car OBD2 ports.

1. Cloned the latest Freematics code from Github
2. Loaded the firmware_v5/telelogger folder
3. Set CELL_APN to "telstra.iph" (Telstra SIM)
4. Set SERVER_PROTOCOL to PROTOCOL_HTTPS
5. Upload to device

In all tests, hub.freematics.com never recieves any data.
The end result is always "Error connecting to server" in the console.

After further debugging, I can confirm the issue is triggered/occurs at line 1049:FreematicsNetwork.cpp
(if (sendCommand(0, HTTP_CONN_TIMEOUT, "+CHTTPSOPSE: 0")) {)...

Also, this issue does not occur via WiFI or via SIM PROTOCOL_UDP.

Has anyone been able to get HTTPS working over SIM on their Freematics One +?

Thanks again.

Re: Issues sending data via HTTP(s) using Freematics telelogger

Posted: Fri Jul 17, 2020 11:22 am
by daveywatt
This issue has been resolved thanks to Stanley. He's pushed up a fix to the repo.

Thanks again mate 👍

Re: Issues sending data via HTTP(s) using Freematics telelogger

Posted: Mon Sep 21, 2020 8:33 am
by Macintosh666
I also had such problems, but I turned to my friend. It's just that I like to play more in https://mr.bet/at/game/view/demo/wild-water and I better understand this type of game. I think it's great that money can be made easily and quickly.

Re: Issues sending data via HTTP(s) using Freematics telelogger

Posted: Thu Dec 10, 2020 2:37 pm
by Rajeevmishri
Thanks for sharing , This issue has been resolved thanks to Stanley. He's pushed up a fix to the repo.