arm cortex M7 same70 with sim808 GPRS 2 way communication

Go To Last Post
24 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hello I'm using sim808 module with M7 sam e70 

I can use AT commands to send data to a specific url or ip and save that data at the URL

but my problem is the opposite way of communication , i have no idea how to send data from the web server to my cortex m7 that is connected to sim808

it will be nice if any1 helps me or atleast tell me where to start .

thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Mostafa.aliaeldin wrote:
atleast tell me where to start

Sounds like you need to start by forgetting about the SIM808, and understand about the basics of TCP/IP networking.

The whole point of the IP stack is that it works exactly the same irrespective of the underlying physical hardware, and the specific type of communication link.

So think what is necessary for any IP device to connect to any other IP device ...

 

Study standard TCP/IP textbooks, tutorials, etc ...

 

This might help: https://www.jmarshall.com/easy/http/

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Mostafa.aliaeldin wrote:
i have no idea how to send data from the web server to my cortex m7 that is connected to sim808

If you want the server to push data (without an explicit demand from the SAM/SIM side):

Your sim808 will have an ip number (i.e. an Internet address). On the web server you use this ip number to address your SIM module (and thus your SAM E70).

How to do that on the web server depends on what software it is running, and what you want to accomplish.

On the SAM/SIM side you will need to write code to have a tcp port open that the firmware is listening on. Essentially this turns your SAM/SIM into a server.

 

An alternative is to let the remote server be the server, and your SAM will make regular requests asking this server if there is new data.

 

You are taking on a big challenge, given the background knowledge you display. Not that it will be impossible, but you should prepare yourself for a major effort taking substantial time, reading, coding etc..

 

You will ask for help a lot, and in order to talk to people that can help you it is essential that you learn basic TCP/IP terminology and concepts. I suggest starting with these Wikipedia articles:

https://en.wikipedia.org/wiki/In...

https://en.wikipedia.org/wiki/In...

https://en.wikipedia.org/wiki/Tr...

 

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

JohanEkdahl wrote:
Your sim808 will have an ip number (i.e. an Internet address).

aka "IP address".

On the web server you use this ip number to address your SIM module (and thus your SAM E70).

But note that this is only possible if you have subscribed for a Public IP Address - which is usually an added-cost extra.

 

If you don't know what a "Public" IP address is, then that will be part of your study ...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

Mostafa.aliaeldin wrote:
atleast tell me where to start

Sounds like you need to start by forgetting about the SIM808, and understand about the basics of TCP/IP networking.

The whole point of the IP stack is that it works exactly the same irrespective of the underlying physical hardware, and the specific type of communication link.

So think what is necessary for any IP device to connect to any other IP device ...

 

Study standard TCP/IP textbooks, tutorials, etc ...

 

This might help: https://www.jmarshall.com/easy/http/

thanks man but i was looking for the way to accomplish my goal with at commands or w/e i'm not interested in networks to study all this 

but thanks a lot for your help

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

JohanEkdahl wrote:

Mostafa.aliaeldin wrote:
i have no idea how to send data from the web server to my cortex m7 that is connected to sim808

If you want the server to push data (without an explicit demand from the SAM/SIM side):

Your sim808 will have an ip number (i.e. an Internet address). On the web server you use this ip number to address your SIM module (and thus your SAM E70).

How to do that on the web server depends on what software it is running, and what you want to accomplish.

On the SAM/SIM side you will need to write code to have a tcp port open that the firmware is listening on. Essentially this turns your SAM/SIM into a server.

 

An alternative is to let the remote server be the server, and your SAM will make regular requests asking this server if there is new data.

 

You are taking on a big challenge, given the background knowledge you display. Not that it will be impossible, but you should prepare yourself for a major effort taking substantial time, reading, coding etc..

 

You will ask for help a lot, and in order to talk to people that can help you it is essential that you learn basic TCP/IP terminology and concepts. I suggest starting with these Wikipedia articles:

https://en.wikipedia.org/wiki/In...

https://en.wikipedia.org/wiki/In...

https://en.wikipedia.org/wiki/Tr...

 

hello , 

 that's exactly what i need

i succeeded to send data to the web server and saved it on the web database like  webserveripaddress/data1/data2/data3 etc 

and also i used at commands to find my sim808 internet ip , and i sent it to the web server , so the web server already knows my ip

what i need is receiving some numbers from web server , and each number is like a code for me to do a specific action , like if web server sends me 1 , i automatically send my location latitude , longitude 
these codes sent to me can be sent anytime , i don't request them , they're like emergency orders to me

is there some kind of at commands for sim808 to accomplish this ? or maybe i should add an html page at the main code to handle http data ?

i'm lost .

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

JohanEkdahl wrote:
Your sim808 will have an ip number (i.e. an Internet address).

aka "IP address".

On the web server you use this ip number to address your SIM module (and thus your SAM E70).

But note that this is only possible if you have subscribed for a Public IP Address - which is usually an added-cost extra.

 

If you don't know what a "Public" IP address is, then that will be part of your study ...

 

my sim808 card has internet data already and is working and i can find my own internet address after using at commands to set my apn , username , password for my mobile network company (vodafone egypt )

i have no problem with sending data to the web server , this is working 100% for me through at commands 

my problem is i have no idea how to receive data from web server while i'm connected to internet , even when the web server knows my ip .

and i do pay for it and this is not a problem for me .

Last Edited: Thu. Dec 28, 2017 - 05:43 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Mostafa.aliaeldin wrote:
i can find my own internet address

So you can tell whether it is public or not.

 

my problem is i have no idea how to receive data from web server while i'm connected to internet

Again, this is all standard IP networking stuff - so you are just going to have to start studying.

 

You have already been given a number of links to start with ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

So this is about communicating with web server.

 

Here's the next recommendation to read: https://en.wikipedia.org/wiki/Hy...

 

Generally speaking, the HTTP protocol is a request/response protocol. I.e. the client (your local SAM/SIM) makes a request and the HTTP server return a response. This is what happens every time you e.g. click a link in your web browser - the browser sends a request for that page to the server the link is pointing to, and that web server responds with a HTML document which the client interprets and displays.

 

Thus, it is always the client that takes the initiative for an exchange of data. The client can send data in the request to the server (e.g. what specific page it wants), and the server of-course puts data into the HTML document.

 

There are advanced tricks that can be used to have it look like the server is sending data without any specific request from the client but you need to get the basics going first.

 

Also, please understand that to get some specific data from a web server that server needs to be configured/programmed to be able to deliver that data. Thus, in general, work needs to be done at both ends. Perhaps the server you're trying to communicate with already is set up for this and you just havenät described this for us?

 

Can you tell us something about what web server you're trying to communicate with?

Can you tell us what kind of data you're trying to communicate?

How and when is the server sending the data you want to receive?

 

In order to get specific help you need to make a better description of all the above.

 

I won't respond again here until such description is given by you.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

Last Edited: Thu. Dec 28, 2017 - 10:30 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

JohanEkdahl wrote:

So this is about communicating with web server.

 

Here's the next recommendation to read: https://en.wikipedia.org/wiki/Hy...

 

Generally speaking, the HTTP protocol is a request/response protocol. I.e. the client (your local SAM/SIM) makes a request and the HTTP server return a response. This is what happens every time you e.g. click a link in your web browser - the browser sends a request for that page to the server the link is pointing to, and that web server responds with a HTML document which the client interprets and displays.

 

Thus, it is always the client that takes the initiative for an exchange of data. The client can send data in the request to the server (e.g. what specific page it wants), and the server of-course puts data into the HTML document.

 

There are advanced tricks that can be used to have it look like the server is sending data without any specific request from the client but you need to get the basics going first.

 

Also, please understand that to get some specific data from a web server that server needs to be configured/programmed to be able to deliver that data. Thus, in general, work needs to be done at both ends. Perhaps the server you're trying to communicate with already is set up for this and you just havenät described this for us?

 

Can you tell us something about what web server you're trying to communicate with?

Can you tell us what kind of data you're trying to communicate?

How and when is the server sending the data you want to receive?

 

In order to get specific help you need to make a better description of all the above.

 

I won't respond again here until such description is given by you.

1st i really appreciate your help ,

Can you tell us something about what web server you're trying to communicate with?

i'm not a web specialist so idk if my answer is enough , it's a static ip i bought which has something like database , i send data from my arm cortex+ sim808 module to that web server

they're sent like url/data1/data2/data3 etc , and the web server handles them and fill the data in the database

Can you tell us what kind of data you're trying to communicate?

i want to send orders from the web server to the sim808 gprs module so for example if i get 1 i want to shutdown the arm mcu , if i get 2 , i send my location , the orders are sent manually from the web server , but the actions are auto which i'll program my mcu to do .

How and when is the server sending the data you want to receive?

how ? it's probably by adding a button at the web server that sends these orders to the the sim808 gprs module ip saved 

when ? it's manual so no specific time for it it's like controlling many units each has it's own ip so i have to locate them on demand and sometimes i want to shut them down .

Last Edited: Fri. Dec 29, 2017 - 12:21 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Had a a long reply to you almost done, and then I lost all of it. I won't retype. Sorry..

 

This is because there is a nasty bug in the AVRfreaks web server, that the amateurs administrating this web site can't fix.

 

Send a PM to user mt_nor and complain.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Had a a long reply to you almost done, and then I lost all of it. I won't retype. Sorry..

 

This is because there is a nasty bug in the AVRfreaks web server, that the amateurs administrating this web site can't fix.

 

Send a PM to user mt_nor and complain.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Mostafa.aliaeldin wrote:
i'm not a web specialist

You don't need to be a specialist - but, as has already been said a couple of times, you do need to understand the basics.

 

If you don't understand at least the basics, you are not going to be able to implement it on a microcontroller!

 

Again, this is all about using standard internet protocols & procedures - nothing specific to microcontrollers.

 

it's a static ip i bought which has something like database

That doesn't really tell us much.

 

i want to send orders from the web server

So what facilities does this "web server" provide for initiating outgoing connections?

 

You are going to have to find that out - from the documentation and/or support service for this "web server" - and implement the corresponding facilities.

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK, I've steamed off again, and realized that the question is to interesting to give up - and that you should not be punished for the amateurism of the AVRfreaks maintinbers.

Please read through what follows thoroughly. I spent between one and two hours thinking and typing this response.


We now know you are sending data to a server which runs a web application or a web service. (I'm guessing on the latter but at this point the distinction is not important. Further on it will be!)

 

For clarity I will refer to this server as "the remote", and to your combo of a SAM microcontroller and SIM module as "the local system".

 

I see two options for you. Both will require re-programming/re-configuration of the remote. For both options some UI elements and code will be added on the remote - example I will use is the "Turn off" command. A button will be added to the UI of the remote, and there will be code "behind" that button to handle the button being clicked. How it is handled depends on which option that is chosen.

 

OPTION ONE: Polling the web service

When a user clicks the "Turn off" button the remote stores this in a collection of "commands" that are ultimately to be executed on the local system.

 

The local system polls the remote periodically asking for any pending stored commands. The remote replies with the collection of pending commands. This reply can be in e.g. XML format or JSON format. The local system parses this reply and acts on each command.

 

Fixing the frequency with which the remote is polled depends on several thtings, e.g.:

- How fast you want the local system to react 

v/s

- How much traffic/load you want on the connection and the remote system.

 

The advantage of this approach is that, for the communication proper, it uses the same technique that is already used for sending data to the remote. No new ports needs to be listened to. No new protocols needs to be implemented.

 

The same goes for security. If there are any security measures in place (encryption, authorization through a "session" on the remote) then this option can capitalize on that and re-use the same technique.

 

You can think of this as "the local system pulls commands from the remote".

 

OPTION TWO: Listening for commands

The local system constantly listens on a port with a "well known" (i.e. fixed) port number.

 

When a user clicks the "Turn off" button the remote immediately sends the corresponding command to the local system.

 

Since the local system constantly listens for commands it can act immediately upon reception of such.

 

This alternative in essence makes the local system a server of sorts. A protocol needs to be implemented, but it could be as simple as a "raw TCP connection". You will need to design a format (protocol for message format) that sender (remote) and receiver (local) share.

 

As for security this is something that you might want to implement to. I take it that you do not want a presumptive attacker to reveal that the protocol is trivial and that this attacker can send commands to be executed with ease.

 

You can think of this as "the remote pushes commands to the local system".

 

Which way to go?

Instinctively I think the first alternative (polling the remote) would be the easiest way to go. The possibility to re-use existing communication is a big plus. Using a security solution that might already be in place is another big plus.

 

So far the alternatives. Now for..

 

All the unknowns, and what you're taking on

There's a lot of things we don't know. An apparently you too..

 

Regardless of which approach of the above you select you will need to

- Obtain knowledge about what kind of system the remote is. A web server or a web service (similar things but the distinction will become important).

- Obatin knowledge about how the remote is programmed/configured. What platform and programming language is used? (There exists literally hundreds of alternatives here. A web server/service might run plain C or C++ code, PHP, Perl, Python, Ruby, Java, C#, JavaScript.. It probably uses a software framework to help with the HTTP/web stuff and there are many such.

- Get info on how (or even IF!) you can do changes to the web application/service.

- Obtain at least basic knowledge about security with respect to web applications/services.

 

To try to give a picture of the work effort involved, I present this "thought experiment": Let's play with the thought that you would hire a professional to do this for you. I'm not meaning to talk about costs, but just how many hours it would take said professional to implement this. Here's a rough estimate (lower/upper bounds given since the tasks is still very open and unspecified):

 

I'm guessing a week at the very best, "a few" weeks would be realistic. I.e. at least 50 work hours or so, and I would not be surprised if it was "a few" hundred work hours hours. And this is if done by a full-blown and well experienced professional. It does not include the actual implementation on the local ARM.

 

I'm giving this guess-work of an estimate so that you know from the start that this will be a major thing to take on as a beginner in "web programming". Expect to spend many work weeks on it. (As a comparison I was involved in calculating a bid for something similar: A web service with a database at the back end. Clients that communicated with this web service. It was a bit more involved than what I believe you want to do but we still ended up with several hundred work hours for a team of experienced developers. I have no actual outcome numbers - we didn't get the job.)

 

No, sorry. There is (to my knowledge) no "one-stop fix-it-all cookbook solution" that fits your needs.

 

You are facing a list of major tasks, the first of which is to read a lot, learn a lot and obtain a lot of factual info (e.g. the things I listed above). If the web server/service is programmed using a language and platform that is unfamiliar to you then you will need to learn that (and learning the first web platform is the hardest. For the second, third ... n-th it's usually a bit simpler, in my experience, since there are common patterns, structures etc - and the underlying protocols - e.g. HTTP, XML, JSON - and problem areas - e.g. security - are the same.) Since you confess to not having any knowledge or previous experience with "web programming" you're starting from scratch. Please understand that there are  some things that are essentially different when it comes to "web programming" as compared to the programming you know, e.g. from coding for embedded systems in general.

 

As 'awneil' has commented above, this is mainly about "web programming". The coding for the SAM microcontroller will most likely be the easy part. There might be some heavy learning and work to get the SIM module to play nice. The work on the remote (web service/web server) will be the tough part for you. (This is because of your lacking knowledge and experience - for an experienced web developer with no knowledge about embedded systems programming it would be the other way around.)

 

I'll end up on as positive a mood as I can: I think what you're taking on is a very exciting and interesting project! If you succeed I'm sure many here would be interested in a write-up. At least I would!

 

It has not been my intention to be discouraging - but you need to be realistic about the scope of what you've taken on.

 

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

Last Edited: Fri. Dec 29, 2017 - 09:26 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

JohanEkdahl wrote:
OPTION ONE: Polling the web service

:

:

The local system polls the remote periodically asking for any pending stored commands.

Note that the polling doesn't necessarily have to be specifically for commands - the web service could return commands as part of its response to any request from the local system.

 

This reply can be in e.g. XML format or JSON format.

In principle, the reply can be in any format - HTTP can carry arbitrary content.

It depends on what & how much control you have over the remote system ...

 

The advantage of this approach is that, for the communication proper, it uses the same technique that is already used for sending data to the remote. No new ports needs to be listened to. No new protocols needs to be implemented.

Also:

  • no need no need for a Public IP address on the local system;
  • no incoming ports which could be attacked;

This is why, in fact, this is the "normal" way to implement such  system.

 

OPTION TWO: Listening for commands

The local system constantly listens on a port with a "well known" (i.e. fixed) port number.

This requires that you have a Public IP address, and that your network provider allows incoming connections.

Note that this is usually not the case - nor even an option - on consumer SIMs ...

 

And it also means that you need some way to tell the remote system the IP address of your local system.

Plus, if it's not a Static IP address, that adds the trouble of monitoring when it changes, and updating the remote system ...

 

EDIT

added notes on IP address for local "server"

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Fri. Dec 29, 2017 - 11:06 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
This reply can be in e.g. XML format or JSON format.

In principle, the reply can be in any format - HTTP can carry arbitrary content.

OK, let's rephrase to "Often used (or conventional?) formats are XML and JSON. Web application/service frameworks often have support for generating those formats built in."

 

awneil wrote:
This requires that you have a Public IP address, and that your network provider allows incoming connections.
 

i) Routers often support a "DMZ" (De-militarized zone) technically allowing external connection "requests" to one specific host on the local, "unrouted NAT network". There's also often a similar technique available, called "port forwarding" IIRC.

ii) A fixed IP address is not necessary if the local machine can find out its own IP address. It can then regularly push it up to the remote system, essentially telling it "Hello, this is 'local' and this is where I'm at: 1.3.4.2". (Yeah, I know.. A "class A" address in very unlikely, but it's just an example..)

iii) I haven't tested if my provider when I use the 3G/4G puck blocks incoming connections. The puck router as such does NAT but has no provisions for DMZ or port forwarding so I can't test on that. I know my DSL provider does not block incoming requests since I, for a while, ran a server placed "on the inside" of the router, in the DMZ, and I could FTP to it when away from home.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

This requires that you have a Public IP address, and that your network provider allows incoming connections.

JohanEkdahl wrote:

i) Routers often support a "DMZ" (De-militarized zone) technically allowing external connection "requests" to one specific host on the local, "unrouted NAT network". There's also often a similar technique available, called "port forwarding" IIRC.

Yes, but the OP is using a cellular connection - so (s)he does not have control of the "router"

Therefore, this relies on the Service Provider making such a service available.

 

ii) A fixed IP address is not necessary

Indeed - all I said was that a Public address is necessary.

 

But I did add:

if it's not a Static IP address, that adds the trouble of monitoring when it changes, and updating the remote system ...

DDNS (Dynamic DNS) would be a way of doing this...

 

iii) I haven't tested if my provider when I use the 3G/4G puck blocks incoming connections.

It's not so much that the puck itself blocks it - rather that the Networks provides no route for incoming connections.

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
the OP is using a cellular connection - so (s)he does not have control of the "router"

In this case (ie, for GPRS), this "router" is the GGSNhttps://en.wikipedia.org/wiki/GPRS_core_network#Gateway_GPRS_support_node_(GGSN)

Image result for ggsn

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

One common way to provide a "back-channel" to a cellular device - without having to set up incoming IP - is via SMS:

 

You could either send the actual command via SMS, or just use it as a signal to tell the local system that it needs to make a request into the remote ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

JohanEkdahl wrote:
Web application/service frameworks often have support for generating [XML and JSON] built in.

Indeed.

 

But, traditionally, they have not been well-suited to "M2M" applications - as they tend to be rather "heavy weight".

 

Nowadays, that may not be such an issue - especially as we're talking Cortex-M7 

 

As noted, it does depend on how much control the OP has over this "web server" ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
But, traditionally, they have not been well-suited to "M2M" applications - as they tend to be rather "heavy weight".

JSON was explicitly designed to be less complex than e.g. XML/XSS.

 

awneil wrote:
Nowadays, that may not be such an issue - especially as we're talking Cortex-M7 

The Cortex-M7 will parse the data, not generate it. The generation is on the remote.

When writing the Cortex-M7 code the specification of the data format will be much narrower than e.g. "anything JSON". With a well-designed data format it should be possible to write a "compact" parser to run on the SAM Cortex-M7.

Formats/protocols like XML or JSON have the advantage that they simplify debugging. Eavesdropping on communications is relatively easy. And mocking up a data generator also becomes relatively easy.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

JohanEkdahl wrote:
JSON was explicitly designed to be less complex than e.g. XML/XSS.

Yes, but it is still pretty verbose.

 

The Cortex-M7 will parse the data, not generate it.

Yes, I know - that's why I said it's probably not such a big deal nowadays.

 

With a well-designed data format it should be possible to write a "compact" parser to run on the SAM Cortex-M7.

Indeed - but, again, depends on how much control the OP has 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

guys I don't know how to thank you 

I really appreciate your , your replies have been a great help to me

I'm using your replies as a reference and I'm working on it now , and I'll let u know what results I got

thanks a lot .

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

it worked 

thanks a lot :)