4 posts / 0 new
Last post
Triggermouse
Triggermouse's picture
Data being sent only when WIFI is available

I have a Javascript function setup on the module right now that simply grabs some data, and passes it to my API every 60 seconds like so:

function Test(){

 var object = {};
    var log = OvmsCommand.Exec("re stream list")
    var lat = OvmsMetrics.AsFloat("v.p.latitude");
    var lng = OvmsMetrics.AsFloat("v.p.longitude");
    object.log = JSON.parse(log);
    object.lat = lat;
    object.lng = lng;

HTTP.Request({ url: "https://api.testrun.com/api/datadump", headers: { "Content-Type": "application/json", "Authorization": "Bearer " + accessToken }, post: JSON.stringify(object) });

}  

And this works great when I am sitting at home, and the module it connected to my local WIFI. However, when I take a drive, and once I am out of range, the data is no longer passed to my API. I have my antena attached, and it has been working via Hologram since day one. So I am hoping there is a setting or command that I might be missing here? Thanks in advance for your time!

 

 

dexter
dexter's picture
Data being sent only when WIFI is available

Check for DNS issues. If you set a custom DNS, that needs to be accessable via GSM as well. I recommend leaving the DNS setting empty to allow the DNS assigned by your GSM provider.

Regards,
Michael

sechava4
GSM Problem

Also facing the same problem. Already checked DNS issue by leaving it empty and also the google public DNS with no results, what else could it be? my device connects to server v2 with gsm but is not able to perform HTTP requests. 

dexter
dexter's picture
GSM Problem

If the server v2 connection works, but HTTP doesn't, that's an indication your provider blocks HTTP traffic.

Some "free" providers redirect HTTP requests to advertisement sites. Some also force you into using some data compression proxy. You should check if you can access HTTP freely when using the SIM in a mobile phone / tablet. If not, check if your provider offers an option to enable that.

Regards,
Michael

Log in or register to post comments