USB using for extern dongle


5 posts
by wolfsweden » Thu Jan 03, 2013 8:38 am
Hi guys and girl :D

As the beginner i am i got a question regarding an idea i got for home.

im about to buy a R pi for to able to use an tellstick net from telldus.
i want to connect to and use my nexa control for all electric at home. for example roof lights, coffee maker and so on. especially coffee maker :) returning from work and ten minutes away from home, take my iphone and start the coffee maker from the car for fresh coffee. or the bubble bath/sauna.

is this possible? it works like this.
the dongle sends radiosignal to the receivers for on/off. the command comes from a website i connect to trough an app at the phone, ipad etc. the app sends command via 4G to the site, the site send to R pi and R pi to dongle and to the recievers.

im a complete novis so bear with me.
sorry if my english is quite bad, its been ten years since i studied in school.

best regards wolf.
Posts: 2
Joined: Thu Jan 03, 2013 8:26 am
by redhawk » Thu Jan 03, 2013 9:50 am
For a USB mobile network dongle to work the chipset must be supported by Linux.
However since you want to control your Pi remotely I can see this being a problem already.
Mobile / cell phones with internet access are normally allocated a random internal NAT IP address like a wifi router the problem with this is you can make outbound connections but you won't be able to accept incoming connections.
A better solution would be to control the Raspberry Pi using SMS, checking and reading text messages is a doodle using AT commands.
i.e.
AT+CMGF=1 (enable SMS reading)
AT+CMGL="ALL" (display all messages)
Use Google search for help on other AT commands.

Richard S.
User avatar
Posts: 3317
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1
by wolfsweden » Thu Jan 03, 2013 10:14 am
redhawk wrote:For a USB mobile network dongle to work the chipset must be supported by Linux.
However since you want to control your Pi remotely I can see this being a problem already.
Mobile / cell phones with internet access are normally allocated a random internal NAT IP address like a wifi router the problem with this is you can make outbound connections but you won't be able to accept incoming connections.
A better solution would be to control the Raspberry Pi using SMS, checking and reading text messages is a doodle using AT commands.
i.e.
AT+CMGF=1 (enable SMS reading)
AT+CMGL="ALL" (display all messages)
Use Google search for help on other AT commands.

Richard S.




AH! damn! sorry for my swearing.

i think the tellstick support linux tough. sms is the last resort from my point of view. hmm, yes its IP based but hmm, how should i put it. isnt the command pass trough? if you know what i mean? the incoming internet signal from my phone to my router goes right trough to the USB dongle via the cabel from the router to RP i? isnt this possible?

the problem is that its need to be hooked up to a computer to work.

best regards wolf.
Posts: 2
Joined: Thu Jan 03, 2013 8:26 am
by redhawk » Thu Jan 03, 2013 11:05 am
Internet access isn't the problem here mobile networks do not have the capability to receive incoming connections because they use a NAT network.
The only other possible way around this is to use a 3rd party ftp or web server i.e. homepage space given by your broadband provider.
You create a file containing the commands, upload this to your userspace and get the Pi to periodically check for the presence of this file.
When found the Pi would read and execute all commands then remove the file automatically from the server.
This method should work but given the fact you have to periodically poll the internet you're effectively eating away at your data allowance.

SMS or text messaging is probably a better and simpler way to control your Pi there is no need for internet access you send a text containing the commands from your phone to the number allocated to the data dongle (and this is how it should work).
A USB data dongle is nothing more than a dial-up modem with a virtual serial port (some have ethernet capability but not as common) you need to write a python script to communicate with it.
A dial-up modem is controlled by "AT" commands the examples I gave you in my previous post would display all received text messages.
All your script has to do is check for new messages, read new message, translate message into commands, remove text message, execute command as required.
If you still want to pass commands to your webserver then you can do this by calling the program wget i.e. wget http://127.0.0.1/cgi-bin/cmd.cgi?(command string) etc.

Richard S.
User avatar
Posts: 3317
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1
by stepat » Thu Jan 03, 2013 1:06 pm
Tellstick NET is 'cloudbased'.

I've just ordered some RaspberryPI's and I am planning on using one of them to poll data from from the live service (e.g. temperatures).

You can also use th PI to send commands to the service and the live-service then executes them by contacting the Tellstick net hardware.

Works just fine behind nat. The Tellstickdongle is responsible for keeping the connection to the live-server and thus is more or less immune to nat problems... I've have my TellstickNet 'double-nat:ed'... :)

It shouldn't be necessary to connect the tellstick net directly to the raspberry, it can reside anywhere as long as it has connection to the Internet.

Very convienient. But, the convinience has a price. The fact that it has to have connection to the Internet is a drawback. If the Internet fails you aren't even able to light up the christmas tree without a good old 433.92 Mhz remote... :) With Tellstick Duo you dont have that limitation but instead you will need a server in the network to manage the tellstick.

Communicating directly to the tellstickNet is not yet supported. Maybe if you look around in the telldus forums you can find some code, as I understand the telldus company are welcoming anyone in programming a api (or fw maybe?) for direct access to the tellstick net. They have an open approach.

As an interesting startingpoint you can go to http://api.telldus.com/ where you can find "information and sample code for develop against Telldus Live!"

The amount of data used in these requests are negligible. And connections in sweden generally use public ip-adresses, even mobile internet. No worries.

Also: Have a look at Remotestick for Android and TellEvent for ios

/stepat
Posts: 1
Joined: Thu Jan 03, 2013 12:32 pm