Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New demos added. #295

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

New demos added. #295

wants to merge 2 commits into from

Conversation

Xoffio
Copy link

@Xoffio Xoffio commented Jan 16, 2019

I wrote two new demos:
gpsSimpleTest: this demo only shows the GPS data and change light when restart. It is very simple for beginners to understand.

httpsConnection: some people including me. had or are having problems to understand the SSL demo. This demo connect to a website and send a POST or GET, very well documented. This demo closes #225

@dtekluva
Copy link

dtekluva commented Apr 6, 2019

Hi Ricx8,

@dtekluva
Copy link

dtekluva commented Apr 6, 2019

I'm using the pudding A9G for the first time and i'm stuck at compiling projects.

I get a host of errors as though some files are missing, with "missing operand" as the last error.

Hoping you could help some how.

Thanks

@Xoffio
Copy link
Author

Xoffio commented Apr 7, 2019

Sure! what os are you compiling the demos?

@dtekluva
Copy link

dtekluva commented Apr 7, 2019

I'm compiling For windows 10

@Xoffio
Copy link
Author

Xoffio commented Apr 7, 2019

Unfortunately I compile then on Linux so I haven't try on Windows... Did you follow this tutorial step by step?
Please make sure you follow that tutorial step by step. You can post the errors that you got.

@andyman2240
Copy link

andyman2240 commented Apr 9, 2019

@RicX8 , How would you go about getting the time and date from the GPS data once you achieve lock? Could you add that to the gpsSimpleTest demo. Thanks.

@dtekluva
Copy link

Thanks ,@RicX8 was able to compile code on windows, problem with github exempting some files when using direct download.

Still trying to get the hang of this board tho . does it require an external MCU??

@Xoffio
Copy link
Author

Xoffio commented Apr 15, 2019

Thanks ,@RicX8 was able to compile code on windows, problem with github exempting some files when using direct download.

Still trying to get the hang of this board tho . does it require an external MCU??

@dtekluva No. It does not required any external chip. That is what I like about this chip. The problem is that there is not too much documentation out there so you have to dive into the examples a C codes....

@Xoffio
Copy link
Author

Xoffio commented Apr 15, 2019

@RicX8 , How would you go about getting the time and date from the GPS data once you achieve lock? Could you add that to the gpsSimpleTest demo. Thanks.

@andyman2240 Right know I don't have too much time but here is how you do it.
Looking into the code you will find this . That is the structure of GPS_Info_t (the one that we use to get the coordinates)
Note that they are using the structure minmea_sentence_rmc If you Google it you will find THIS

struct minmea_time {
    int hours;
    int minutes;
    int seconds;
    int microseconds;
};
struct minmea_sentence_rmc {
    struct minmea_time time;
    bool valid;
    struct minmea_float latitude;
    struct minmea_float longitude;
    struct minmea_float speed;
    struct minmea_float course;
    struct minmea_date date;
    struct minmea_float variation;
};

so type something like:
gpsInfo->rmc.time.hours etc...

I know! there is not documentation for that!! anyway I hope that helps you :)

@dtekluva
Copy link

Hello again guys, sorry to be a bother. But after loading code into the device it seems to no longer have perform any activities. Even the indication lights go no longer flash. please any ideas.

@CallaDai
Copy link

@dtekluva @RicX8 sorry to trouble you. I use the tomcat service and I want to try the httpsconnection. but I dont know how to replace the server_path, server_path_post, server——data, and for the certificate data, I didn't have it. I just use the http, so can I ignore this data?

@CallaDai
Copy link

"/test/setLocation.php?location=A9G:443_v23" // [GET] Replace this with your path
"/test/setLocationPOST.php" // [POST] Replace this with your path
"\r\nlocation=A9G_POST_v23" // [POST] Replace this with POST data
sorry, I also want to know how to write the above 2 page? I don't know how to do that. can you teach me? Many thanks.

@dtekluva
Copy link

Sorry for the late reply, i actually did not make any success using the AI tjinker board, So i defaulted to a Nano, Neo 6m, and Sim 800l.

I'll like to know your experience. @CallaDai

@mkf118
Copy link

mkf118 commented Dec 28, 2019

Hello,
I try to compile builds from demos and i can't find an information about restoring to factory build.
I need to use AT Command Tester, but my board not responding with debug build (about TX and RX communication).
Thank You in advance :)

@dtekluva
Copy link

dtekluva commented Jan 1, 2020

Hi @mkf118 sorry i switched to using an atmega with sim800l for my GPRS project because i really couldn't figure the AI thinker board out. If you can't too, i don't know how far along you are on your project but you might also be better off switching.

@ismavg
Copy link

ismavg commented Jun 18, 2020

Hi
I tried using this demo. I get a success 200 ok response but the body is empty. I tried different hosts. The same hosts are good in curl or postman

@JazminFerre
Copy link

"/test/setLocation.php?location=A9G:443_v23" // [GET] Replace this with your path
"/test/setLocationPOST.php" // [POST] Replace this with your path
"\r\nlocation=A9G_POST_v23" // [POST] Replace this with POST data
sorry, I also want to know how to write the above 2 page? I don't know how to do that. can you teach me? Many thanks.

ey, could u solve it ? I want to use it but i dont wanna configure the certificate.
thanksss

@Xoffio
Copy link
Author

Xoffio commented Jul 24, 2021

"/test/setLocation.php?location=A9G:443_v23" // [GET] Replace this with your path
"/test/setLocationPOST.php" // [POST] Replace this with your path
"\r\nlocation=A9G_POST_v23" // [POST] Replace this with POST data
sorry, I also want to know how to write the above 2 page? I don't know how to do that. can you teach me? Many thanks.

ey, could u solve it ? I want to use it but i dont wanna configure the certificate.
thanksss

Can you be more precise? You just have to replace the link with the one you want to request. If you have more questions keep in mind I haven't do anithing with this chip in a long time

@JazminFerre
Copy link

"/test/setLocation.php?location=A9G:443_v23" // [GET] Replace this with your path
"/test/setLocationPOST.php" // [POST] Replace this with your path
"\r\nlocation=A9G_POST_v23" // [POST] Replace this with POST data
sorry, I also want to know how to write the above 2 page? I don't know how to do that. can you teach me? Many thanks.

ey, could u solve it ? I want to use it but i dont wanna configure the certificate.
thanksss

Can you be more precise? You just have to replace the link with the one you want to request. If you have more questions keep in mind I haven't do anithing with this chip in a long time

I am sorry. I want to connect to a server but I don't have much experience so I was trying your code but I don't know how to configure the SSL certificate. The server is Heroku.
Thanks!!!!

@Xoffio
Copy link
Author

Xoffio commented Jul 24, 2021

"/test/setLocation.php?location=A9G:443_v23" // [GET] Replace this with your path
"/test/setLocationPOST.php" // [POST] Replace this with your path
"\r\nlocation=A9G_POST_v23" // [POST] Replace this with POST data
sorry, I also want to know how to write the above 2 page? I don't know how to do that. can you teach me? Many thanks.

ey, could u solve it ? I want to use it but i dont wanna configure the certificate.
thanksss

Can you be more precise? You just have to replace the link with the one you want to request. If you have more questions keep in mind I haven't do anithing with this chip in a long time

I am sorry. I want to connect to a server but I don't have much experience so I was trying your code but I don't know how to configure the SSL certificate. The server is Heroku.
Thanks!!!!

Got it. So basically the server that you are trying to connect NEEDS to have a certificate already (of course). Then you can get the certificate with a command like this:

$ echo | openssl s_client -servername google.com -connect google.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'

You can see that I got the certificate of Google. If you check my code demo/httpsConnection/src/demo_httpsConnection.c line 31: Is where the certificate of my old server was. So go ahead and change it with yours.

Am I answering your question?

@Abibor
Copy link

Abibor commented May 7, 2023

@Xoffio Hello, can you help me to make ssl post request to firebase? I successfully make GET request but my post request is fail - "ssl read fail: -6". My post request:
snprintf(retBuffer,retBufferLen,"POST /GpsTags/.json?auth=mySecurityKey1231232131123 HTTP/1.1\r\nHost: fieldercontrol-11c25-default-rtdb.firebaseio.com\r\nContent-Type: application/json\r\nContent-Length: 31\r\n%s\r\n\r\n", data);
Where could i make a mistake?

@Abibor
Copy link

Abibor commented May 7, 2023

@ismavg Hello! I had a problem with my Get request too. You should specify the number of bytes to receive per line:
int strLength = 372; // this is length your message. you also can see this length in postman
ret = SSL_Read(&config, buffer, strLength, 6000);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to establish a connection to a HTTPS endpoint and make POST and GET requests.
8 participants