How to use a mobile provider's UUSD code service via an automated process? - ussd

If I have a SIM card from a mobile operator - for example, Vodacom in South Africa, I can use their USSD services via dialling *111#. Then I can navigate the options via using my mobile phone keyboard.
I would like to create a script that does this in an automated way. Is there a way to do this?
I see this is possible on an Android application (Make USSD call in android). Is there a way to consume a specific mobile operator's UUSD service without first purchasing a SIM card from that operator? (i.e. running this from a server over http/tcp).

To access the USSD menu you need to be on the mobile network. USSD is not internet, nor even data network. USSD is transported on mobile signaling network. Thus you need to have a SIM.
To navigate on a USSD menu via scripts, you may need few steps.
You need a GSM device connected to your computer. A USB Modem is OK but all modems don't have this functionality. I have been using a Huawei 180E model.
You'll need to talk to your modem over a serial line. On Linux, USB Modems can be reached as tty devices, typically on /dev/ttyUSB0 (there is no absolute rule: some models only define 2 devices, some models define 4). For tests, you can use some terminal software. I use miniterm.py, a Python program, but minicom is OK as probably many others. For automation you may need a serial library for your preferred language. On the command line, there is atinout but I didn't manage to make it work properly, socat - /dev/ttyUSB0 should also work.
Finally, to talk to your modem, you need to use the Hayes Modem AT commands. You can read the AT command reference [3GPP 27.007][1], chapter 7.15 for a formal documentation, but basically, sent to the modem (without the #... part):
ATZ # to reset the modem
AT+CUST=2 # to close any ongoing USSD session
AT+CUSD=1,"#111#",15 # to initiate the navigation
and if you get the menu, you're fine; if not, well, things are not desperate, but it may be more difficult as you'll probably need to play with character encoding.
[1]: https://www.etsi.org/deliver/etsi_ts/127000_127099/127007/10.03.00_60 (/ts_127007v100300p.pdf

Related

How to send direct command from Google Home to custom smart device without app name?

I try to build my custom IoT device that will be controlled via Google Home device, and serve people with disabilities.
The device itself is Tiva C Launchpad, that I program from scratch, meaning I will have a full control on it.
In my vision, the user wil say something like: "Ok Google, press play button", and as a result, the Google Home device will send a direct command of press_play_button to the IoT device, preferably via the local network.
I found the Google Action SDK, alongside with the Local SDK extention, but if I understood correctly, I have to be in the app mode first ("OK Google, play {app_name}") before pronouncing the action I want, which is inconvenient.
Is there any way to achieve my requirement?
If not, I may give up on the local network control, and use sort of a webhook to send HTTP request to my smart device, and in that case I wonder if MQTT will be more suitable.
Thanks.
The Local SDK is an extension to the Smart Home API. If your device matches up with the device types and traits that the Smart Home API supports then you can use that to control your device.
It has support for media players so things like play/stop should be possible.
I have build generic Smart Home control using MQTT to reach the device, but you have to provide a HTTP endpoint for the Google System to interface with. This take a little thought as you have to map MQTT asynchronous approach to HTTP's synchronous nature.

See devices connect to my wifi router using Swift and allow/block wifi acces

In short i'm trying to build an App that will grant/block wifi access to my son's wifi for his Ipad and his PS4 remotely using an App. I researched the topic and can't figure out how this can be done. Ideally i'd like to be able to grant/block wifi access independently Ie. block wifi to the Ipad and allow PS4.
How can this be done, no need for the full code ( well if you insist i'll take it ) but just point me in the right direction.
Depending on the router you're using you're going to need to write something that interacts with the router's API, if it has one. If it doesn't, you will need to replace the firmware on your router with something like ddwrt that can be scripted. From there, you might be able to create an app that talks to the router's API.
TLDR: You're probably better off simply bookmarking the management page for the router and enabling/disabling access for the devices.
Edit:
It occurred to me that some mainstream consumer router/access point manufacturers (Linksys, Asus, etc) have companion apps for managing their devices from the LAN side. You should see if such an app exists for your router, and if not, perhaps consider getting a different router that supports such an app.

How to link/pair HTML 5 with a hardware device?

I have two entities which I would like to be able to start a communication:
Hardware Device Using Atmel ATSAMS70 and WINC1500 Wifi Module
HTML 5 App
The idea to have a HTML 5 app is to be able to communicate easily with most of the commercial devices like: Windows computers, Android Phones, Mac OSX computer and iOS devices. Apart from that, I would avoid working with native code at all.
Currently, they can talk with each other using WebSockets but somehow the IP address of the custom board has to be known from HTML 5 to initiate the communication.
In order to do this, I can think of 3 options:
Using WebRTC I can get the local IP address of the browser and then I could do a scan of the local devices considering a 255.255.255.0 network mask.
Have an external server that the hardware device can send its local address which will be later retrieved by HTML 5.
Using Bonjour or some sort of device discovery service between the board and HTML5.
I could not find a way to achieve #3 but #2 seems feasible to me. #1 is what I am doing now, but WebRTC is currently not supported on iOS.
So, is there any other better possibility to achieve this communication?
You don't mention how the WINC1500 unit is being connected to the network but presumably this is in STA mode (acting as a wifi station rather than becoming a software access point or part of an ad-hoc network) and is being provided with its IP details through an existing access point?
Ordinarily I'd suggest that once connected, the device ought to start indicating its availability on the network via a regular UDP broadcast on a specific port but my (admittedly limited) understanding of WebSockets it is that it creates TCP connections. The only implementation of Bonjour that I've seen uses UDP messaging too, that may be why you've had trouble with your third approach.
Your second approach seems more likely to work well. A server at a known (or discoverable) IP on the local network which allows the Atmel device to register itself (and its IP address) and also allows other applications (your HTML 5 WebSockets applications) to request that connection information to allow them to create the WebSocket TCP connections they need.
I suppose that doesn't really answer your question as to "Is there a better way?", other than to say "Not that I can think of, your second approach looks good to me...". Sorry! Sounds like a very interesting project, overall,

Can an iOS app control a phone call?

My Mom's deaf. I typically talk to her using a TTY service and she has a TTY phone at her house. I've looked in to iOS TTY and all it ever says is about connecting a cable to the iPhone to use a physical TTY. TTY uses 50bit per second baud-dot code for communications it should be trival to write a program that generates it on the iPhone. Just a sequence of tones, at a relatively low baud rate. BUT I need to be able to control the phone functionality from an app... Then I could type messages like "txting" and have it send baud dot code to my mom's phone. (I've tried giving her a computer, but she's 86... Old dog... new tricks...)
Any ideas?
No, it not possible. The official iPhone SDK does not allow this kind of interaction with the phone.
You can't do this on the phone, but you could try to make a webservice that does it instead. Then have the app connect to the service to deliver the message.
TAPIComm on this page looks like a sample to work from
http://www.tapi.info/default.aspx/TAPI/PSDKSamples.html
You'd need to run it on a Windows machine with a modem.
I know you were looking for an iOS solution, but it another option might be to switch her to an android phone, since android gives you MUCH more access to basic, deep-down elements of the OS, including access to the voice data stream.

iPad accessory communication through UART

We manufacture a new accessory for iPad/iPhone which should transfer commands to the iPad. We like to use UART (through a certain Apple-protocol called Lingo). My research shows that I can only use USB (30PIN Connector) and custom protocols.
Question:
Is there any way to use UART to connect to the iPad accessory from APP side?
If the protocol is implemented in UART, we should be able to move it to USB, if it's not available to my App via USB.
My main guess is that the UART commands & access are protocols reserved to the iPhone OS and not available to Apps. Certain UART commands also include settings for volumes and Audio re-routing etc, so I guess that's secured.
Without jailbreak, you will not be able to access UART on iPad/iPod/iPhone as a normal developer. If you need access to the serial port or USB, you need to join Apple's MFi ("Made for iPhone") program and you will get full access to all relevant information. Unfortunately, you'll have to convince Apple that you're doing serious business and have a high volume manufacturing facility at hand (see also this thread).

Resources