FONA and https

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
darrensillett
 
Posts: 19
Joined: Wed Aug 06, 2014 6:05 pm

FONA and https

Post by darrensillett »

I've been trying to get the FONA to access an https site - which are becoming ever more popular especially with REST APIs.

Trying the command to query available SSL:
AT+HTTPSSL=?
I get the response
+HTTPSSL: (0-1)

This seems to indicate that SSL is supported (1).
So, set SSL enabled:
AT+HTTPSSL=1
I get the response
ERROR

Strangely though if I query the SSL state with:
AT+HTTPSSL?
I get the response:
AT+HTTPSSL=1
Which would seem to indicate that SSL has been enabled.

But, if I try to open an https URL I get an error status 603.

Has anyone been able to get https working on the FONA board?

User avatar
darrensillett
 
Posts: 19
Joined: Wed Aug 06, 2014 6:05 pm

Re: FONA and https

Post by darrensillett »

Looking into this further, it appears that the SIM800 used in the FONA does not support full https.
It does however support https redirect e.g. http://www.gmail.com -> https://www.gmail.com.

For my application, I was able to workaround the lack of full https and utilize this redirect support. YMMV.

I've added support to the library to enable the https redirect functionality (and also retrieve the I M E I).

https://github.com/darrensi/Adafruit_FONA_Library

Feel free to use and enjoy.

User avatar
solardude
 
Posts: 145
Joined: Fri Oct 18, 2013 12:47 am

Re: FONA and https

Post by solardude »

Keep up the good work!

Thanks for pushing this forward for everybody else.

And I'm curious how your going about using this HTTP data usage? Are you browsing websites? Pulling data from them? Just curious. I know you can do that on the PI but I'm on Arduino only so far.

User avatar
darrensillett
 
Posts: 19
Joined: Wed Aug 06, 2014 6:05 pm

Re: FONA and https

Post by darrensillett »

I'm trying to communicate with a REST api.

So far, I've been able to perform http GET requests through a http/https redirect using the limited SSL support available. I've been trying to perform http POST requests with a similar setup but I've not had any success there yet.

From what I can gather, the SIM800L used in the FONA does not support full SSL. The SIM800H does. I wish that the FONA used a more capable chip but I'm assuming that came down to cost.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: FONA and https

Post by adafruit_support_mike »

Cost and complexity.

It would be easy to make a version of the FONA that costs $100 and needs a mid-sized ARM processor to run all the support/interface code.

User avatar
darrensillett
 
Posts: 19
Joined: Wed Aug 06, 2014 6:05 pm

Re: FONA and https

Post by darrensillett »

I get the cost argument.

For complexity is their other functionality in the SIM800H that you would need to support? Otherwise they are pin-compatible.

It looks like the SIM800H is approximately a $1 more expensive (in bulk) than the SIM800L ($6-ish to $7-ish).

Maybe an ultimate FONA for an extra $5-10 which has a better chip?

User avatar
solardude
 
Posts: 145
Joined: Fri Oct 18, 2013 12:47 am

Re: FONA and https

Post by solardude »

I wonder if you could use a SMD rework tool to remove the SIM800 and reflow the SIM800H back down?

I've seen Spark Core do this when removing the TI CC3000 Wifi Chip.

smorgan
 
Posts: 3
Joined: Wed Jul 09, 2014 1:28 pm

Re: FONA and https

Post by smorgan »

solardude wrote:I wonder if you could use a SMD rework tool to remove the SIM800 and reflow the SIM800H back down?

I've seen Spark Core do this when removing the TI CC3000 Wifi Chip.
This won't work because the pinouts are different. Many more pins on the SIM800H.

User avatar
gerrydark
 
Posts: 2
Joined: Fri Apr 03, 2015 10:09 am

Re: FONA and https

Post by gerrydark »

I'm trying to get this to work following your instructions, but somehow the FONAtest sketch keeps reporting back with "Failed!".

I need to send some data from the FONA to google docs.
I'm using this awesome work-around from Josh ( http://wp.josh.com/2014/06/04/using-goo ... ensor-data ) that enables you to append data entries to a google spreadsheet by HTTP_GET.
Great for data logging from the Arduino over the net!
But I need HTTPS support for this.

I hacked the FONAtest sketch to hard-code the url below.
I masked the unique google-docs-code for privacy ( AKfycbyP... <random-code> ...do7XaOLe ), but I guess you get the idea.

When I use fona.setHTTPSRedirect(true) it reports back with:
( it does this for any https request, not only the one below )

* FONA report *
NOTE: in beta! Use small webpages to read!
script.google.com/macros/s/AKfycbyP... <random-code> ...do7XaOLe/exec?Text=Lorem ipsum dolor sit amet...
****
Failed!
* FONA report end *


When I don't use fona.setHTTPSRedirect(true) it reports back with:
( at least I know the fona is working as expected )

* FONA report *
NOTE: in beta! Use small webpages to read!
script.google.com/macros/s/AKfycbyP... <random-code> ...do7XaOLe/exec?Text=Lorem ipsum dolor sit amet...
****
Status: 301
Len: 507
<HTML>
<HEAD>
<TITLE>Moved Permanently</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Moved Permanently</H1>
The document has moved <A HREF="https://script.google.com/macros/s/AKfycbyP... <random-code> ...do7XaOLe/exec?Text=Lorem+ipsum+dolor+sit+amet...">here</A>.
</BODY>
</HTML>
* FONA report end *


Are there any additional settings I'm missing?
Any tips? Thanks.

After playing around a little it seems sendCheckReply(F("AT+HTTPSSL=1"), F("OK")) in HTTP_initialize responds with false.
I'm not that experienced with libraries but thought it might help if anyone is looking at this post.
Anyone any idea how to get it working? Thanks.

User avatar
DYNAMASOL
 
Posts: 14
Joined: Mon Feb 02, 2015 2:12 pm

Re: FONA and https

Post by DYNAMASOL »

Hello, I have also been trying to connect with my adafruit FONA to an https server (parse.com server). I was thinking to move to the SIM808 for my project but now I need to make sure how both the SIM808L and SIM808 can connect to a server that only works with HTTPS SET,GET,PUT,DELETE BANNED. If these modules cannot connect to this kind of servers, which ones from SIMCOM can? Thank you in advance

User avatar
justrack
 
Posts: 1
Joined: Thu Jan 07, 2016 10:45 pm

Re: FONA and https

Post by justrack »

Here is an update with my experiences:

As of Dec 22, Adafruit switched the FONA 800 to use a SIM800H instead of the SIM800L. I picked up a new one with the SIM800H thinking it would have all the SSL support needed for HTTPS, secure email and FTP. However once getting it and trying it, I still got an ERROR with "AT+HTTPSSL?"

So after a bit more research I found this document:
http://mt-system.ru/sites/default/files ... _v1.01.pdf
This document can apply to SIM800 series modules, including SIM800, SIM800-WB64, SIM800H without bluetooth function and SIM800G.
So it seems not all SIM800H have SSL support, only ones without bluetooth function. I know the FONA 800 does not officially have bluetooth, but it seems the firmware loaded does support bluetooth which means, according to the above document and my experience, it doesn't support SSL.

After looking some more, I was able to find Firmware and the Firmware loading tool for the SIM800H here:
https://github.com/OLIMEX/OLIMEXINO-NAN ... %20UPDATES

There is a firmware version for bluetooth support and one for no bluetooth support. I was able to load the one with no bluetooth and all my SSL functions are now working!

Note that the readme instructions in the above link is for a different device (still a SIM800H chip). But all I had to do was use a USB TTL serial adapter to connect FONA to my computer (the same way you would to issue commands to it), and follow the instructions for setting up the firmware loading tool in the readme (NOTE: Additionally, I did have to change the Format FAT option to enable it under Options). In order for it to start (and also when you are done) you will need to power cycle FONA by unpluging the USB charging cable and the battery, then plugging them back in battery first.

So after all that I am now able to connect to a secure FTP over SSL (TLS). I haven't tried HTTPS yet but suspect it should work no problems now that the commands are supported.

User avatar
mbowie
 
Posts: 1
Joined: Sun May 08, 2016 5:11 pm

Re: FONA and https

Post by mbowie »

Edit: I think the trick here is that the unit I'm working with is the feather... as opposed to the FONA 800. :-p

I'm very keen to get HTTPS working on my unit here, and have come to much the same conclusion as justrack. I wish I'd found this post while I was sifting through resources to get to the bottom of it! ;-) Kudos on your result!

To that end, I'm very interested as to how one might connect USB TTL to the unit. The pinouts for the OLIMEXINO unit show the UART serial as being pins 31 (TXD) and 32 (RXD) on the SIM800H; and on the this unit, those pins pass directly to pins 28 and 29 on the MCU respectively. (I can't for the life of me figure out how the pinouts list pins #8 and #9... they appear to be pure fiction.)

Any suggestions would be much appreciated. Perhaps a mechanism to bump the firmware via the 32u4. Then again, I may be missing something delightfully simple. ;-)

TIA,

Mike.

User avatar
buholzer
 
Posts: 4
Joined: Sat Oct 08, 2016 3:59 am

Re: FONA and https

Post by buholzer »

@justrack This is great news, I am working with the Feather Fona and need to enable SSL. If I understand correctly you are working with a feather as well? If so any tips on how you connected to the Fona TXD? The Fona RXD is available on the regular pinout on GPIO #9, unfortunately TXD on GPIO #8 is not accessible. Did you find a great location to connect?

User avatar
Humphrey
 
Posts: 6
Joined: Fri Apr 01, 2016 4:54 am

Re: FONA and https

Post by Humphrey »

Of course there is a reason why https is coming more and more common. But if you want to ignore those reasons, and just want your FONA to do stuff on https servers, you could have a script running somewhere on your own server that forwards the data over with https to the actual target server. Clearly a far from ideal workaround, but it might get you where you want to be..
The lack of https support makes the FONA way less interesting nowadays.

User avatar
tushar92
 
Posts: 3
Joined: Wed May 24, 2017 6:00 am

Re: FONA and https

Post by tushar92 »

How can I POST to a HTTPS website?
need help.
Thank you.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”