MDBT42 http module using sim808 #4098
Replies: 1 comment
-
Posted at 2020-12-31 by @gfwilliams Hi! What you're doing looks fine - although I'm not sure the console log you posted actually matches the code that you posted up? Are you sure you're not calling Looking at the module the Please could you run Hopefully it'll allow me to make some changes to the module to fix the issue. Posted at 2020-12-31 by michael_101 Hi Gordon,
Yes I Just clean it up to be easier to see the important data.
I am calling it only once manually from the left side of the IDE when the SIM808 is ready - Just for testing. AT Debug:
First request:
Second request:
Thank you, Posted at 2021-01-05 by @gfwilliams Great - thanks! I'll look into this - it seems that your module reports Posted at 2021-01-05 by @gfwilliams Hi - please can you try re-uploading your code and see if that fixes it? I just updated the Posted at 2021-01-05 by michael_101 Hi, thank you Gordon, Now I'm getting this error:
Posted at 2021-01-05 by @gfwilliams Ok - was there anything that came before that? Please can you try changing your I made some other tweaks that would fix this I think but I don't want to push them fully live until you've tested them :) Posted at 2021-01-05 by michael_101 Testing... Posted at 2021-01-06 by michael_101 @gfwilliams thank you very much! Posted at 2021-01-06 by @gfwilliams Great! I'll merge that in :) Posted at 2021-01-06 by michael_101 Until ... :) It's definitely a lot better but I did some more tests, I shut down the remote service while continuing the POST requests to it (every 30 seconds), I got a 'no response' message as expected but it seems to be a memory leak here.
With Debug (Service down all time):
Posted at 2021-01-06 by @gfwilliams Strange... However from the dump it looks a lot like the SIM808 is trying to connect for a while before it gives up? Maybe there's a 60 second connection timeout internally? So what's happening is you're trying to post every 30 seconds, so you're queueing up multiple requests before the last ones have finished. What happens if you just stop making more HTTP requests (maybe with Posted at 2021-01-07 by michael_101 The default timeout seems to be 120 seconds? from simcom. Anyway, I will do the same test with POST requests, service down, 5 minutes interval and see if still there any memory leak. Is there a way to specify a 30 seconds timeout in the GET/POST requests from http module? Thank you. Posted at 2021-01-07 by @gfwilliams
There's no timeout built in to Espruino itself I'm afraid, but you may well be able to issue an AT command to the SIM808 that will configure the timeout? Worst case it might be possible to do a bit of a hack to force the closure of the socket after a timeout, but hopefully it won't come to that. Posted at 2021-01-13 by michael_101 I think it's ok. Posted at 2021-01-15 by michael_101 Hello again, I don't know if this related to the request timeout but I'm posting data every 10 minutes, at first this works ok, but when I got
It might work, but over time after couple requests this getting worse and the majority of the responses are 'no response' with the error above. What I'm trying to establish for now is to find the best way for stable connection and requests so I can continue my project knowing I have reliable way dealing with this. All test I did are when there is a good cellular signal. I tried those 2 scenarios with same results:
2:
Your help is greatly appreciated.. Posted at 2021-01-18 by @gfwilliams Can you try now and see if it's any better please? Posted at 2021-01-18 by michael_101 Hi, I'm still getting the error, this is how it looks using the second scenario when
And then after 10 minutes
Thank you Posted at 2021-01-19 by @gfwilliams Ahh, sorry - this time I updated the Posted at 2021-01-21 by michael_101 Thank you @gfwilliams! It's better now. There is a similar bug with Here is 2 examples.. Example 1:
then every 10 minutes
when the sockets debug look like this
Example 2:
then every 10 minutes
when the sockets debug look like this
Thanks again. Posted at 2021-01-22 by @gfwilliams Are you sure you have a good connection from the SIM808 to the board (including ground?). It's looking like the reason things are going wrong is data is getting lost. For example Posted at 2021-01-23 by michael_101 Hi - the connections are good, close and with 0 resistance from pin to pin (espruino => SIM808) The testing still in progress... Thanks again @gfwilliams. Posted at 2022-11-23 by user151021
How do I get the response in string format. Posted at 2022-11-24 by @gfwilliams
That might be a sign that the baud rate is wrong? Are you sure the module uses 9600 baud? Posted at 2022-11-24 by user151021 With the sim900 module the result is OK!
After sending the above code I use RELP and get the result below:
I would like to know using the sim900 module how do I check if the connection is ok with the APN network and how do I reconnect after disconnection. Ex:
How do I do this with the sim900 module? Sorry if the question is stupid! Posted at 2022-11-25 by @gfwilliams I'm not sure the module itself contains a method, but if you know the AT command you send it's easy enough to add one - the code itself is in https://www.espruino.com/modules/SIM900.js For example:
If you don't want to/can't change it, does getIP not work? I guess if there is no connection you won't have an IP? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-12-29 by michael_101
Hello,
I'm using MDBT42 flashed with the latest firmware (2v08) and I'm experiencing a strange behavior with http module.
After everything initialized using
require('SIM900')
I got ~1300 free memory and then I started getting \posting data from\to a server every 30 seconds and after the first successful response and starting from the second request I'm getting this error but I'm still getting successful responses...... while the free memory decrease every request.
After a couple of minutes I got those errors:
The issue is the same using GET and POST.
Am I doing it wrong?
Is there any better way to do this interval thing?
Here is the full code for my trials.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions