Programming a GSM phone/modem to make phone calls - java

I want to use a program written in a high level language like Java or Python to talk to a GSM Modem.
I want to be able to tell the modem what number to call and when to call it. I also want to be able to read and send text messages.
I do NOT need to handle voice transmission in either direction of the call.
I'd appreciate recommendations of any applicable libraries and specific modems that are good to start with? I like Java but am willing to try something else.
Thanks

There are a set of relatively standard "AT" commands that can be used for these types of operations - including placing phone calls and sending text messages. Some details around this are at http://www.smssolutions.net/tutorials/gsm/sendsmsat/ and http://www.dreamfabric.com/sms/ (simply first results of a little online searching).
A little more online searching yielded a Java-specific example at http://www.java-samples.com/showtutorial.php?tutorialid=22 .
I had done a little bit of this in Java a number of years back, using the Java Communications API - available at http://www.oracle.com/technetwork/java/index-jsp-141752.html . (My purpose was for interfacing with the phone book on my phone, but this also should have worked with interfacing with the SMS system.)

Almost all modems and (phones which support tethering to your PC) can do this. All modems are equally good at it.There are no starter's modems. Just go through the AT commands specific to your applications and thats it.

Related

Trying to communicate to a USB port/Device in Java on Mac

I have a basic understanding of network programming but i have never had anything to do with USB ports.
This is what i am trying to achieve
I need to write a program in Java, to communicate to a device which is connected to USB port and then later send commands.
I tried terminal as follows earlier but it didn't quite work
ls -l /dev/tty.*
screen /dev/tty.usbserrial-FTYRDSX7 9600
The above didn't work out.
So if someone can just guide with what Java classes i should be looking into and if there are any APIs that should help me get started
Unless you're required to build it from the ground up, use a library such as usb4java (also here). Trying to manage it as a block device and interpreting whatever protocols etc., etc is not worth the effort unless there something very unique to your problem.
So i ended up using jssc which is much easier to use with strait forward syntax and methods

GPS over USB Example for Java, or some other Windows program?

I am looking to record movement based on GPS, and plan to record it on the laptop that is in the vehicle. It looks like GlobalSat BU-353 is a good pick, but I am not clear on how to write a program for the actual receive/record. The existing answer seems to be fore Serial, and does not appear to be helpful for USB systems. I could use a USB-to-serial converter with a Serial based GPS device, but I don't like this complexity.
Can you point me a working example? I don't mind using a foreign language (Python perhaps), as long as I can run it on Windows without too much installation/programming headache. Please point me to evidence that this can be done, and how. Preferably a working example that was tested with x USB receiver.
Also I would like information on what the risk of compatibility problems there would be. I would expect that there are many programs out there along with many GPS devices so that a standard has been established (like USB cameras), but is this really the case?
Look up Prolific Technology USB-to-serial converter software. You install it, then your USB device data can be read off of one of Windows COM ports. I'm using the RXTX library to read the com port that is getting my USB data (RXTXcomm.jar).
It's a bit of a pain, because you don't know for sure which COM port is going to be used, it can depend on the order things are plugged into the USB ports on the machine, etc. On some machines, the same physical USB port tends to gravitate towards the same COM port, however, so maybe that will make things predictable enough. Anyway, that's what I'm using to read USB data. At least it's the installed converter, which does not involve code, and everything is java from there.
Yes, there is a defacto standard for the GPS output, the NMEA data strings. All the USB GPS devices I've come across use this. Essentially, as soon as they're turned on (which means as soon as they're plugged in), they start emitting strings of data in the NMEA format. The first letters designate what kind of record is being reported, and the rest of the string is the data. I'm sure some of them also have query capability, etc., but given the nature of GPS programs in general it also works in a lot of cases just to have the device spit out the characters until someone unplugs it. Each string is less than some reasonable maximum number of characters (80? 132? don't remember), and is terminated with some kind of EOL. My code reads them all and only processes the ones it's interested in.
Hope that gets you started.

Is it possible to record audio from client to server in PHP- or JAVA-based online web application?

I am building an online web application which offers clients to test their language skills.
The application consists of series of different test the clients can freely do. One of these tests is one where the client sees a sentence on the web-page and then is required to speak the sentence to a microphone. The idea would be to record the audio stream, send it to server and save it there to a file.
Is this possible using PHP, Java, or something similar to them?
Thank you for any help :)
I know you asked for PHP, I'm guessing that's your language of choice, but have you considered using html5 to record your audio? Note: browser support is still lacking but it might be worth looking into depending on your requirements.
Check out this tutorial; it uses the GETUSERMEDIA API to access you camera and microphone hardware.
Update: Here is another good tutorial on the subject.
The only realistic solutions for solving the problem are with flash, as suggested by another answer, or a java applet. In a year or two that will hopefully change and you'll be able to use javascript and HTML5, but this is now.
I would say this is a problem better and more easily solved with flash, but for java, You need to write a java applet to do the recording. Here are some hints to get you started:
http://docs.oracle.com/javase/tutorial/deployment/applet/
http://www.java2s.com/Tutorial/Java/0120__Development/CapturingAudiowithJavaSoundAPI.htm
http://www.jsresources.org/
You do not need java speech API or JMF, just java sound. You might WANT JMF to compress the audio file to make uploading go faster, but you can get this working without. Note that you may need to "sign" your applet in order to record audio in a browser.
If you are averse to flash, you could also use haxe to write your flash code.
Not 100% what you're looking for but I think it'll at least give you some ideas.
How to record streaming audio to the server
It is possible to solve this problem using Flash and Java both. You can use Flash component to record sound and send it in chunks to server side which can be implemented using java.
Pros to create sound recorder in Flash are many.
Flash is widely installed plugin in Browser
Java Applet gives warning before running it which many times turns off users.
Numerically checked, most media applications are created using Flash thereby providing you nice support.
Java Applets are used where thick client has to fit into browser and must also be secure. You will still find many real time treading applications are written in java applets.
Here are couple of tutorials to create Sound Recorder in Flash
http://active.tutsplus.com/tutorials/actionscript/create-a-useful-audio-recorder-app-in-actionscript-3/
Adobe record sound and save
This collected stream of sound can be stored in chunks on client side and can be synced with backend server(any server side language shall be fine.).
Implementing your server in Java has advantage. If tomorrow need arises, you can stream the same sound using Red5 server which is implemented in Java.
See more here: http://www.red5.org/
There is an audio recording SDK for this which is written in PHP, Flash and HTML5. http://recordmp3online.com
I am actually the author of that SDK (full disclosure)

Output sound to multiple channels of the sound card

I am trying to build a program in Java, which would be able to output sound to different output lines on my sound card.
How is it possible to do in Java?
I'm not sure what background you have in working with sound (it might be bigger than mine) but what I think you have is a number of lines that you want to direct to a number of ports? http://download.oracle.com/javase/7/docs/api/javax/sound/sampled/package-summary.html - This might be an API for this, which I don't know much about (I've seen a program using something like that with VoIP).
By the way if yr working on Windows, I believe that some information about your soundcard is stored in the registry, and you might have to update the registry from the program to gain access to it (not sure).
I hope I helped somehow :)
Check out the Java sound programmer's guide.
To get this to work I had to reconfigure my sound card to expose its ports as separate "outs"; otherwise the sound card would route the sound automatically depending on whether a pair of headphones were plugged in. (On Windows.)
You can use Jack (Jack Audio Connection Kit) to route sound to your soundcard. It is a little complicated, it doesn't work with pulseaudio, but you can make it work.
JnaJack provides an interface from Java to the Jack API via JNA. It's really quite easy.
I wrote it up in more detail here.

How do you interface with a USB to Parallel adapter?

I'm currently doing a project where I have to interact with a circuit I made through the parallel port of a computer. However, my computer doesn't have a parallel port so I borrowed a Parallel to USB adapter cable. The cable didn't come with any drivers, but it's recognized by the device manager as a "USB Printing Support" controller, under the USB section.
It seems that old parallel printers can be plugged in and work properly without any problems. So my question is, if I write a program in Java that tries to interact with a parallel port directly, will it work? And if not, can anyone give me some pointers as to what I need to do to interact with it?
Thanks.
I think you should head toward javax.comm library here.. there is also a different version that is supposed to work better, called librxtx.. take a look here (it's a pluggable replacement for javax.comm)..
I used both of them for an embedded device and they worked great, they manage serial and parallel port.. maybe also usb in your case.
I can't speak for parallel or Java but I've done something similar with serial-via-USB and C#. In that case it was exactly the same as a native controller. YMMV.
As for testing things: get an old dot-matrix printer (and put it in hex dump mode if you really want the nitty-gritty).
If you really want drivers for the thing, find a utility (I think the windows device manager can do it) that gives you the vendor ID and product ID numbers and from those you can look up all kinds of fun stuff (many Linux distributions have a plain text file that maps the numbers to the name of the manufacturer and what not) that plus Google should give you a driver installer.
You need java parallel port drivers which I haven't found for free. You'll have to pay for the driver for Windows.
I think there might be some free drivers if you use Linux.
USB "parallel port" adapters and cables generally aren't. They contain chips that emulate USB printers and send the print data out the parallel port like it might be sent to a similar printer using a parallel (printer) port.
Unless the device you have is actually a printer, there are probably very few (if any) adapters that will work.
There are ways of attaching GPIO "parallel"/bus pins into USB including certain FTDI chips, UARTs and various microcontrollers. If you can write software to use one of these, it could let you drive arbitrary circuits the way olde PC parallel ports were (not through the same MMIO, though).

Categories