Look at the source of the page that has the username and password fields and the URL it submits to, do a curl request to that URL with those fields filled out and it will populate the cookies that let you do other things.
Then do a curl to the page that displays the SMS's and you will be able to pull them out with a bit of effort. There are many many tutorials on using curl to webscrape things like this.
Not really at the moment. I have too much on to get into the headspace to be able to tackle something like that. Dealing with renovations and tradespeople really take it out of you.
Cloud spending continues to surge globally, but most organisations haven’t made the changes necessary to maximise the value and cost-efficiency benefits of their cloud investments. Download the whitepaper From Overspend to Advantage now.
Firstly - should have checked back here before. What Richard said above:
It was a case of a setting on the hotspot and plugging it in, then an ifup command on its interface name
Was exactly what I needed to do to get the pi working. The only issue I am currently having is that it seems to be somewhat flakey in what order the pi is turned on, and the usb dongle connected... but I'll get that worked out soon enough I hope! Anyway, the trick is that the usb dongle creates a gateway (for me, at 192.168.9.1) and you can then just configure your network/interfaces to bring up ethernet and away you go.
It is _also_ possible to read SMS's off the modem stick. Now, the only way I have worked out how to do this (and it's an evil kludge) is to basically spin up a virtual browser and click around on the web interface which is presented at the 192.168.9.1 address. It's evil, but it works. I imagine there must be a nicer way to pull the data straight off the USB stick, but that low-level stuff is a little beyond me, and I just wanted to get the (damn thing!) working. I will actually try cURL this weekend, no cookies required I suspect as there was no login required. If it all rails, my ruby script will come to the rescue ;)
Anyway, success! very happy to be able to send data off the pi, and SMS it.
Thanks for all the help, and Richard, I wish I'd properly read your comment before. There's so much info out there (like the SAKIS script etc.) which is just totally irrelevant these days.
I have moved on from a hotspot to a T-stick driven with wvdial. Works fine but you have me intrigued. From what you just wrote it sounds like you are using a (because it's a router) rather than a stick (which AFAICT is just a modem). Sooo . could you expand on what ifup does here? And a bit more about your "pseudo browser" ....
One of the problems I couldn't solve with the hotspot was that if the power was turned off long enough for the battery to go flat, then it needed a (physical) button push to restart which was a bit hard if it is up a 10m pole.
Linux seems to wisely not just enable any old ethernet USB device that is plugged into the machine untill root says so, where as windows you plug it in and suddenly its sending all its traffic via it.
Note, it has been flakey dependent on whether the modem was turned on first or not.. but it did work. I will get to the bottom of that, but haven't managed it yet.
As for the browser stuff, again, it may be possible to use straight curl, but, in the meantime, I am a Ruby programmer by trade, and one of the tools I use is called watir (https://github.com/watir/watir/ ) So I installed iceweasel (Firefox).. and then I can use a ruby script to automate the clicking around the pages. It's by no means finished yet, but I have tested sending a text and seeing it appear on the webpage... now it's just a case of wrapping the functionality so that, ultimately, I can just call something like raspberrysms get_latest_message and it'll just give me the latest SMS details. Again, haven't even started it yet, but at least all the pieces are working now.
That said, if you managed to get wvdial working, can you use that to pull the sms's off somehow? (I really have no clue how that stuff works, and I'm not sure I want to ;)
If and when I get the SMS browsing stuff working I'll post a link, but it will be _very_ specific to my vodafone modem stick setup, so I'm not actually sure how much use it would be.
Thanks again to Richard for suggesting cURL... I had a closer look at it, and indeed, was able to do everything I wanted through cURL.
Anyway, for anyone who's interested, and on the vodafone network, and who has Ruby installed on their pi (or anywhere else).. I have made a start at a gem for talking to the vodafone dongle. At the moment, you can connect, disconnect and get the status. I do know how to do the SMS's .. just haven't yet put it together - tomorrows job ;)
If you're interested: https://github.com/patrickdavey/vodem_sms
Well, I can read SMS's etc, and I have had the modem connecting to the internet, however, at the moment it's DNS settings seems broken, and I'm not quite sure why. If I do a traceroute to google I get this:
1 192.168.9.1 (192.168.9.1) 0.909 ms 1.599 ms 1.792 ms 2 172.27.74.44 (172.27.74.44) 1141.241 ms 1143.081 ms 1143.172 ms 3 172.27.66.219 (172.27.66.219) 1243.072 ms 1243.110 ms 1243.119 ms 4 172.27.87.69 (172.27.87.69) 1275.568 ms 1275.273 ms 1242.989 ms 5 172.27.87.70 (172.27.87.70) 1275.574 ms 1275.299 ms 1275.616 ms 6 203.109.129.190 (203.109.129.190) 1275.370 ms 1242.945 ms 1242.237 ms 7 203.109.129.189 (203.109.129.189) 1209.486 ms 105.834 ms 105.253 ms 8 203.109.180.225 (203.109.180.225) 105.353 ms 133.821 ms 147.434 ms 9 203.109.180.226 (203.109.180.226) 149.173 ms 147.342 ms 147.348 ms 10 192.168.59.254 (192.168.59.254) 146.812 ms 82.653 ms 126.443 ms 11 * * *
So, it's trying to get out (some of those addresses are vodafone ip's) but it's coming back with 192.168.59.254, which is quite wrong.
If anyone has suggestions I'd love to hear them. I opened a more full StackOverflow question here: http://raspberrypi.stackexchange.com/questions/30052/network-issues-with-huwaei-usb-3g-modem
Just a bit of an update - in case anyone is interested - on how I have more or less cracked the stick-on-Pi-and-SMS problem ...
I used a Spark ZTE stick - installed wvdial and it all goes fine. Not all that hard even.
For texts, there's gammu - which makes SMS's too simple as well.
Next project is to get a reverse SSH set up on the Pi so I can get a connection to something on the other side of a standard cell modem - for a provider where there is no "inwards" APN. I have a certified geek coming to do that for me next week. With any luck I'll sort of understand it after he has worked his magic :-)
I could run a reverse VNC the same way too. That might actually be simpler to set up. I don't have to have them there all the time as I can just send an SMS to get whatever I want fired up.
Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly
to your computer or smartphone by using a feed reader.