I am currently working on a hobby project where I am using a PIC controller and a sim900 modem for remote monitoring, over a GPRS connection.
I can upload data from my remote device on to the server in regular intervals.
Now I would like to send some control signals to the device from the server, but how do I find which device to send data to? I need to know the IP address of the device which is assigned dynamically.
Is there a static IP on GSM modem, or can anyone please suggest a solution for this?
You need to contact your service provider(SIM card providers) to assign a static IP for your SIM card.
Other option is you have to develop a simple application layer protocol for data transfer over TCP/UDP in which once the connection is established your modem should send its identity(Name/ID etc.)
On the server side you need to write the code in which you have to maintain a dynamic table of modem details and socket number. When the modem is connected you can send data over the same socket for control commands.
Related
I'm using "ARDUINO mega-2650" with ETHERNET shield based on "WIZNET W5100" for connecting my ARDUINO to ETHERNET devices such as a switch, router, local pc, meters, etc.
In my application, I want to accept data from local devices connected in LAN and transfer that data to my SERVER application. basically, my ARDUINO will act as a transparent gateway.
Currently, I'm using TCP protocol to connect with my SERVER application and local devices present in LAN. hence my ARDUINO is working as a MASTER for local devices and CLIENT for my SERVER application. with TCP protocol my ARDUINO is working fine, but this method is limited with devices that support TCP application for communication only.
As of now, I want to connect my ARDUINO to an "ETHERNET METER MACHINE" which does not follow TCP protocol, hence I'm not able to process or accept any data from it. This "ETHERNET METER MACHINE" only sends data to the particular IP address in form of IP packets.
Can anyone suggest me a way to access all data coming at my IP address in ARDUINO without using any specific higher level protocol like TCP or UDP. For transferring or redirecting that data to the server application, TCP is fine. Is there any reference for pure "IP PACKET processing", access HEADER of each data packet for fetching any information like "SOURCE IP ADDRESS", "DATA LENGTH" etc. As I'm not very well aware of ARDUINO functions and libraries, can anyone guide me for above IP packets extraction part, any inputs will be highly appreciated.
Thanks and regards
Aatif Shaikh
enter image description here
my setup would look like this:
ubunutu linux pc running Asterisk Server
analog phone connected to the VOIP ATA adapter
VOIP ATA adapter connected to Asterisk Server via Ethernet
I have only found information about setting up an extension within the Asterisk Server for the ATA. Here the SIP account for the phone is configured within Asterisk, it becomes clear to me that the Asterisk Server needs to be powered on at all times, otherwise the ATA won't be able to send/receive any phone calls.
My Question
Is it possible to let the ATA adapter store and manage the SIP accounts while the Asterisk Server monitors incoming calls (I need the called id) and also can send a desired phone number to the ATA to initiate an outgoing call. With this even if the Asterisk Server is powered down the user still is able to make/receive calls via the ATA adapter using the analog phone. If this is possible, could you please give me a reference or hint how to setup the Asterisk extension for this situation?
If you have linksys adapters, you can create dialplan on adapters to callout directly other adapter(with static ip) in case if server is down.
On most adapters you can use backup proxy if primary proxy failed
Thats all.
In most case if your server is down, you have no phone service
I am able to access to my IOT device if I assign it a static IP with a service like dydns. But I would like to be able to reach it without relying on something.
I was thinking that my IOT device could ,on every start, write in a database its IP adress so my script on the server knows its ip.
The problem is that the IP will correspond to my hotspot IP. I am missing the connection part "hotspot -->IOT device".
For example I would like to be able to connect my IOT device to my mobile phone in hotspot mode.
One way to do this would be to re-design your system: if when it comes online the IoT device always connects (and stays connected) to a server component (which has a well-known/unchanging hostname/IP address), then the server can always send the IoT device a command over that TCP connection without knowing the hostname/IP address of the IoT device, and without it having to be contactable from the internet, i.e. this approach is firewall-friendly at the device end.
This is how the IoT is architected when using e.g. MQTT: devices connect inwards to the MQTT broker (i.e. server). MQTT also removes the need for the server application itself to need to connect to the clients. MQTT uses a concept called publish/subscribe with pre-agreed 'topics' - the client will subscribe to a 'command' topic, the server app publishes commands to that topic and the broker handles forwarding the command to the device. Incoming data from the device is published to another topic and the server application subscribes to that topic, the broker forwards the published data. You can try pub/sub example (using a browser, but real devices can also connect to the same server) using e.g. http://m2m.demos.ibm.com/utilities.html
I am trying to send data using the AsyncUDPSocket class. And I can send data using the iPhone simulator over the wire to another machine that is running a simple C-coded listening server. I can also receive data over the wire using a client connected to the simulator(server). However, when I tried the same over Wifi, using the simulator, I could only send data but not receive any data.
I read on another post, that unicast data makes this possible. How can I acheive this using AsyncUDPSocket?
Thanks,
Angelo.
Ok, I figured this out. A newbie kind of thing, really.
When I set my Mac network preferences to Ethernet, I get an IP for me to communicate. However, when I turn Airport(Wi-Fi for more newbies) ON, and ethernet cable disconnected, I checked my network preferences, and sure enough my IP address was a different one.
Spoke to a friend (an ace in networking) and the thing clicked immediately: On WiFi networks a DHCP server allocates an IP address. This IP address has to be reserved, at the very least, at the DHCP server. Since my IP was not reserved, I had to change the IP address, in my udp_client.c file, recompile and run the client to connect.
BTW, I can now communicate between my iPhone and my PC using my local WiFi (office) network.
For any who might face the same problem, do not be assured that the IP address of your mchine is the same, when you switch from LAN to Wifi, and use the device mostly for WiFi reated testing. :)
I have two network cards in my server, and both of them are connected, one is connected local and other one internet,
I have created a SMTP service, the problem is that the smtp only tries sending emails from the local network card.
I want it to try send emails from the internet network card, how can this be solved?
SMTP does not know about network interface cards. The decisions is made by the operation system. What does your routing table look like, e.g. the output of "netstat -rn" on a Unix-like OS, and what is the IP address of the destination that your SMTP service tries to connect to?