SparkFun Forums 

Where electronics enthusiasts find answers.

By ljbeng
#206881
Here is the end of a conversation I have been having with Hologram. I get to a certain point in the Send TCP example and I just get gibberish from the serial port.


Hologram:
Hmmm, So the command it errored out on is when it attempting to create the TCP channel, no actual data / command is sent yet. The response, I am guessing, is gibberish likely due to either a baud rate switch or some electrical issue. What power supply are you using, I would suggest using the 5V usb input on the Redboard UNO plugged in to a 2A wall plug. Its possible the modem is browning out when it is trying to send data (that TCP connect command is the first time the modem is actually trying to send where it will use peak power).

If you have an oscilloscope you can connect it to the power input at see if it sags. I would also recommend sending the modem a few “AT” commands and looking for the “OK” after to see if the modem is still communicating after that connection request.

You can also try other endpoints, checkout https://www.u-blox.com/sites/default/fi ... 01820).pdf section 10 for some examples.


ME:

Thank you for your help BTW!
I played with power supplies and even connected a 5v switching regulator so I don’t think it’s power. All power sources do the same thing.

Just going through some of the examples in the link above and typing into the Sara R4 using a serial passthrough program:

Creating a socket works:
Code: Select all
AT+USOCR=6

+USOCR: 0

OK

Any socket connect command causes jibberish back on the serial:

AT+USOCO=0,"3.210.32.221",7
⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮{⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮W⸮ŷ⸮⸮⸮⸮⸮⸮⸮;⸮⸮⸮⸮⸮⸮⸮⸮⸮߯⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮
+CME ERROR: Operation not allowed

....long time goes by.....

+UUSOCL: 0
or

+USOCO=0,"cloudsocket.hologram.io",9999
Command: +USOCO=0,"cloudsocket.hologram.io",9999
Response: ⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮o⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮
4
⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮

....long time goes by.....


+CME ERROR: Operation not allowed


+UUSOCL: 0
⸮⸮⸮
Looking at HTTP examples, I noticed that I get an error after any command such as:

AT+UDNSRN=0,"ftp.u-blox.com"
ERROR
#206953
When I emailed tech support, I get a spam back that I have to post the problem here so I assumed Support would respond. Am I wrong about that?
Hello Luke, and thank you for reaching out to SparkFun’s Support.

The SparkFun Technical Support team has moved is now available on the SparkFun forums. If you are looking for technical assistance we ask that you head over to the SparkFun forums for assistance here:

SparkFun Cellular Forum
We would be happy to research your question and if possible, answer it in the forums. That way, if other users have the same question they and the rest of the community can benefit from your post, and anyone else in the community that has solutions for you can post them as well.
#207072
Greetings Ljbeng. Thanks for posting on the forums.

Hmmm. Sounds like the Sara-R4 module might be in an unknown state. Have you tried resetting the module?

https://learn.sparkfun.com/tutorials/lt ... e-overview

"The RESET button resets the SARA-R4 module to its default configuration. In most cases you should not need to use this button. If you do, hold it down for at least 10 seconds while the module is on. Note that this button has no affect on the Arduino -- it won't reset your sketch."

Try that out and see if the problem is fixed.
#207319
That was tried many times. I had an engineer who makes products like this for a living take a look and he can get the shield to connect to many test sites except the one I need at Hologram. It will not open the TCP connection to that site. Thanks.
#207351
Ive been having some issues with hologram as well. I also happen to have the same ublox on a digi xbee board. I recently got an email saying that the ublox needs a critical firmware update. Im still waiting on their support to respond to me, but it looks like the ublox has a long list of known problems.

ftp://ftp1.digi.com/support/firmware/re ... TEM_NB.pdf

It mentions some issues with ATT in particular, which i was attempting to use through hologram.

Sparkfun mentions interfacing with the ublox through USB directly, but i have found no software availbale that would update its firmware.
https://learn.sparkfun.com/tutorials/lt ... -interface

I'll let you guys know if i get either the SF or digi boards working after support gets back to me.
#207355
I'm having similar problems. I can receive messages from the Hologram Dashboard but am not able to send data to the Dashboard, nor am I able to send SMS messages to Verizon (I haven't tried sending SMS to an AT&T phone). After putting some debug lines in the Sparkfun example script, "02_TCP_Send_Hologram", I'm finding that the function,

"lte.socketConnect(socket, HOLOGRAM_URL, HOLOGRAM_PORT)"

returns a value of "5" instead of "0" (i.e., an error code instead of no error).

So it looks like there are issues with opening a socket.

Using some AT commands to see what's going on with the attempt to connect to a socket, I get the following:

AT+UDNSRN=0,"cloudsocket.hologram.io",7

ERROR
AT+UDNSRN=0,"ftp.u-blox.com"

ERROR
AT+USOCO=0,"195.34.89.241",7

OK

+UUSORD: 0,31
-------------------------
In this case, I can connect to a socket if the IP address is specified directly using USOCO, but dynamic allocation of the address using UDNSRN perhaps isn't working? (The above IP address is for the u-blox site.)

From the Hologram page, the APN settings on the device should be set as follows:

APN: hologram
APN username: (none)
APN password: (none)
IP Address: Dynamic (using DHCP)
Data Roaming: Enabled

I can't tell from the Sparkfun LTE library code whether these are being set correctly.

Below are responses from the set of AT commands that Hologram recommends running to check system status:

ATI

Manufacturer: u-blox
Model: SARA-R410M-02B
Revision: L0.0.00.00.05.06 [Feb 03 2018 13:00:41]
SVN: 00
IMEI: 356726102540374

OK

AT+CGMI

u-blox

OK
AT+CGMM

SARA-R410M-02B

OK
AT+CGMM

SARA-R410M-02B

OK
AT+CPIN?

+CPIN: READY

OK
AT+CCID

+CCID: 8944501810180016906

OK
AT+CRSM=176,28539,0,0,12

+CRSM: 144,0,"FFFFFFFFFFFFFFFFFFFFFFFF"

OK
AT+CFUN?

+CFUN: 1

OK
AT+CSQ

+CSQ: 26,99

OK
AT+CREG?

+CREG: 0,5

OK
AT+CGREG?

+CGREG: 0,4

OK

AT+CGDCONT?

+CGDCONT: 1,"IP","hologram","10.179.43.41",0,0,0,0
+CGDCONT: 2,"IPV4V6","VZWADMIN","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0
+CGDCONT: 3,"IPV4V6","vzwinternet","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0
+CGDCONT: 6,"IPV4V6","VZWCLASS6","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0

OK
AT+CGACT?

+CGACT: 1,1
+CGACT: 2,0
+CGACT: 3,0
+CGACT: 6,0

OK
AT+COPS?

+COPS: 1,2,"311480",8

OK
AT+COPS=?

+CME ERROR: operation not allowed
AT+COPS=?

+COPS: (2,"Verizon Wireless","VzW","311480",8),,(0,1,2,3,4),(0,1,2)

OK
AT+COPS=?

+COPS: (2,"Verizon Wireless","VzW","311480",8),,(0,1,2,3,4),(0,1,2)

OK
-----------------------------------

The ATI command shows the firmware version to be "Revision: L0.0.00.00.05.06 [Feb 03 2018 13:00:41]"
so maybe at least part of the problem is the firmware update issue noted in the previous message, and I need to update to Revision ....05.08.
#207581
aurelius19

Open the library file SparkFun_LTE_Shield_Arduino_Library.cpp and uncomment all the Serial.Print lines if you want to see all that the library is sending. Save the file and recompile.
By ljbeng
#207587
How about HTTP? Has anyone ever got the Sara R4 to send data to thinspeak.com using HTTP? I have tried but failed. I may not be sending all the correct commands.
Code: Select all
void httpSetup(){

delay(20);
Serial1.print("ATE1\r");   //echo on#
waitsr(500);//RECV: 
Serial1.print("AT+CGATT=1\r");   //attach to data network
waitsr(500);//RECV: OK
Serial1.print("+CGDCONT?\r");
waitsr(500);//RECV: OK
delay(10);
Serial1.print("AT+CGACT=1,1\r");   //activate the data connection
waitsr(500);//RECV: OK

Serial1.print("AT+CEREG?\r");
waitsr(500);//RECV: +CEREG: 0,1   //the second param 1 means registered on home network. 5 means roaming.  All others means not registered.
waitsr(500);//RECV: OK
Serial1.print("AT+CGPADDR=1\r");   //Get device’s network IP address
waitsr(500);  

      Serial1.print(F("AT+CMEE=2\r"));   //Set verbose error result codes.
      waitsr(500);
      delay(500);
      
      Serial1.print(F("AT+UHTTP=0\r"));  //Reset the HTTP profile #0.
      waitsr(500);
      delay(500);

      Serial1.print(F("AT+UHTTP=0,1,\"api.thingspeak.com\"\r"));//Set the server domain name and port.
      waitsr(500);
      delay(500);

     
      Serial1.print(F("AT+UHTTPC=0,0,\"/\",\"head.ffs\"\r"));  //HEAD request of the default page and store the result into the "head.ffs" file on the local file system of the module. The +UUHTTPCR URC notifies the success/failure of the operation (inthis example: success).
      waitsr(500);
      delay(500);
      
      Serial1.print(F("AT+UHTTPC=0,1,\"/\",\"get.ffs\"\r")); //GET request of the default page and store the result into the "get.ffs" file on the local file system of the module. The +UUHTTPCR URC notifies the success/failure of the operation (in this example: success).
      waitsr(500);
      delay(500);
           
      Serial1.print(F("AT+UHTTP=0,4,0\r"));//authentication NONE
      waitsr(500);
      delay(500);
      
      Serial1.print(F("AT+UHTTP=0,5,80\r"));//Port 80
      waitsr(500);
      delay(500);
  
}
void httpAction(int type){
      //use GET
     Serial1.print(F("AT+UHTTPC=0,1,\"/update.json"));
      Serial1.print("?api_key=Y3McccccccccccM");
      Serial1.print("&field1=4");
      //Serial1.print(windspdmph_avg2m,1);
      Serial1.print("&field2=5");
      //Serial1.print(winddir_avg2m);
      Serial1.print("&field3=6");
      Serial1.print("\",\"GetFile\"\r");
          waitsr(4000);
    }