Im planning to create an android Raspberry Pi 3 using Lineage OS. My concern is the GSM module. Does Lineage OS can read the GSM Module (SIM900) in Raspberry Pi and detects it as a SIM Card? My goal is to send SMS using Lineage OS Raspberry Pi 3.
The high level view
connect the SIM900 module to the RPi using the serial connection
write a program to send AT commands to the SIM900 to send SMSes
setup a php script in a web server to receive SMS parameters and make it call the program from step 2.
Lower level view
You may want to read this blog to see how to connect your SOM900 to the RPi. There are actually many blogs like this one so if this one is not clear, just Google "Connecting SIM900 Raspberry"
To send SMS you need to send some so called Hayes AT commands to the modem. The Commands are defined in specification "3GPP TS 27.005", but basically you need to do the following (not tested...). This is adapted Python: I don't know the equivalent of serial module in php:
import serial
import time
modem=serial.Serial("/dev/<the serial device>", baudrate=9600, timeout=1.0)
modem.open()
modem.write("AT+CMGF=1\r")
time.sleep(0.5)
modem.write("AT+CMGS=\"<the desination mobile number>\"")
modem.write(";\r")
time.sleep(0.5)
modem.write(<the content of the SMS>")
time.sleep(0.2)
modem.write(chr(26)) # character Ctrl-Z meaning end of message
time.sleep(0.5)
However, if you want to send messages in a specific charset different from the default GSM alphabet, you'll need to need to do some coding (see here).
I believe the Web Server step shouldn't be an issue for you. You need 2 parameters for your script: the destination of the message and the message itself.
Hope this helps.
Related
This is a theorical question. I have no code and I am not looking for that, just knowledge.
I have a raspberry pi with a webserver and a waveshare can-hat. It receives various messages from a dozen devices.
among those messages a few contains data (some informations are divided over multiple messages).
My idea is to receive the messages, restore complete informations and write one file each.
then an ajax call reads each file and displays each value in the webpage. Probably once every second.
Is it possible to do that? is there a better way?
the receiving script will be made in C.
thank you for helping and sharing your knowledge!
I think it would be a better practice if you create some kind of process (or some kind of kernel module or daemon for example) which read out the data from CAN and you use this process with Python and use some sort of Webserver-API to display the data via web.
You can find some ideas for IPC between a C and a Python application here.
So one simple solution would be to create a socket system with a C guest and a Python master. Your Python application is a flask application which waits for a connection of the C application (or vice versa) and the C application transmit all incomming data to your Python application.
This would be a more neat solution than writing and reading a file.
as I mentioned above,
does Arduino Uno capable of running application that is taking input from sensors around 6 sensors and sending that input to a remote database through out internet by using either (Wi-Fi shield, ethernet shield)?
I am asking such a question because I am going to use it in the next semester of academic year as a part of my final year project, but I am worried that it's RAM size is not enough since it is 2KB and I need to decide either using Arduino Uno or switch to Raspberry Pi.
It should be possible, altough you may have a hard time searching for a suitable driver for your database. If using MySQL, there is already a project to do exactly what you want.
Another (more flexible) approach is to write a small PC software to receive sensor data in a simple protocol you define, and write them to the database. Run it on the database machine (or any other machine, really), and then make the Arduino communicate with your proxy software instead.
I am planning to make some microcontroller boards which would do miscellaneous tasks. For example measuring analog voltages or controlling other instruments. Each board needs to be controlled/downloaded it's data from one place. For that purpose I would use an ethernet interface and do the comnunication over that. So my question is: which would be the most suitable method of achieving that. My ideas are: run a webserver on each module and communicate with POST/GET, or run a telnet server on boards and communicate with a telnet client. The security and speed/latency is not an concern but the data integrity is.
I don't need a html based gui for modules because I will implement an application which will communicate wizh the modules periodically, gets the data from them and stores in a database. And the database is what I will use later, for examining the data for example.
An other example:
I have a board which measures measures temperature. There is a server on the board itself run by the mcu. It is connected to a router via the ENC chip. I have my pc also connected to that router. I have an application which connects to the server run by the Atmega328 and collects the data then stores to a database. It repeats this let's say in every hour. I would use an Atmega328 and an ENC28J60 ethernet interface chip. What do you recommend?
I am looking for a tutorial on how to receive an iBeacon signal with a Raspberry PI.
What I am trying to do is monitor a zone of our warehouse. Once a beacon that advertises specific information enters that zone the rasperry Pi should send a REST request to a webservice.
I've found this: Can RaspberryPi with BLE Dongle detect iBeacons? but it does not quite answer my question. Does anyone know of a good tutorial how to implement something like the above?
(the easier the better, I am not exactly a programming whiz ... :-) )
Cheers,
Vitus
My company is working on tools to make doing this easier, but we do not have a tutorial available yet. We are the ones who posted the information you referenced: Can RaspberryPi with BLE Dongle detect iBeacons?
If you want to call a ReST service when an iBeacon is detected, you can use it with the detection script we provided. As the detection script runs, it writes out the identifiers of any iBeacons it sees. What you would need to do is write a separate program that reads in the output of this script, looks for identifiers that it cares about, then calls the ReST service when it sees them.
Connecting two programs by taking the standard output of one and reading it with another is a very common programming technique on Linux. You would run our program with ibeacon_scan -b and it would output the information below:
2F234454-CF6D-4A0F-ADF2-F4911BA9FFA6 1 6 -59
E2C56DB5-DFFB-48D2-B060-D0F5A71096E0 6 9 -55
74278BDA-B644-4520-8F0C-720EAF059935 0 73 -50
You would then read this information in with your second program line by line, parsing out the three part identifier from each line. And then call your ReST Service if the identifiers match the iBeacon you are looking for.
The specifics of how you do this depend on what programming language you want to use. You could do it in C, Ruby, Perl, Java or any other language supported by the Raspberry Pi. If you have a client library for your ReST service, you probably want to build this program in whatever language that client library uses.
Full disclosure: I am Chief Engineer for Radius Networks.
How can i connect a windows phone 7 device with a WiFi-enabled micro controller. Should i use socket programming?? If yes then how?? I actually want to send a text file or a text message to the micro controller using WI-FI??
Your question is a bit vague. Are you trying to write a app that enables you to send a text file/message?
or are you trying to accomplish this by connecting to the microcontroller with the default connection your phone provides.
If you want to write your own app, you can do this by using a windows socket function. Have you looked into the standard code examples windows provides? They provide good examples about the basis of windows phone wifi connectivity
in example:
Example 1
Example 2
Edit:
You should take a look at this example.
Example
In this microsoft example, they make the game tic tac too between two windows phones. For your cause, you can read the data form file. Temporarly store it in an array. And send it over wifi. if you customize the example to fit your needs, so in steps:
Declare a socket (with the right ip adresses, ports etc)
Read file
Store in array
Send array by the wifi (using your previously declared socket)
And then on the microcontroller, you need some way to filter your data out of the incomming wifi buffer. I looked into one of my older projects where i did something like this. But i couldn't find it anymore. So i must have deleted it at some point "sorry :( " i you can work this out using the example