Loading ...
Sorry, an error occurred while loading the content.

RE: RSS reader thread...

(1091)
  • fixitsan2
    Oct 3, 2013 Expand Messages
    View Source
    • 0 Attachment

      Thanks for your encouragement. I really do enjoy spending time to write code which does what I like on microcontrollers. But I'm reaching an age where getting the job done reliably leaves me more time to do what I want, especially with other projects.

       

      Connecting to the web, creating files, mixing up data and then outputting it  over serial is an ideal task for a Pi, Although it is prpobably using too much electricity, and as easy as it was to overclock it, I think it's just as easy to underclock it and save power.

       

       

      The web server idea crossed my mind too, however, I can't seem to come up with an easy way for the user to input their wifi SSID, security mode and passkey, over wifi. It could be done via ethernet, but the target board, a model A device, doesn't have ethernet.

       

      My idea at the moment is for the user to write a few files to a USB flash memory stick using their MAC or PC text editor. 1 file holds the wifi credentials, another holds a list if their preferred RSS feeds. Perhaps another holds a file with special messages and another holds configuration information such as when to blank the display and so on.

       

      Those files could be written by hand via the text editor, or I could try my hand at making a python GUI  to create them .

       

      Then when the Pi boots up it could check the USB for a file system (IE not a wifi dongle) and import the settings, then ask for the wifi dongle to be inserted, via the attached Smartsockets.

       

      Even just using the USB stick to get the wifi credentials on board is actually enough to get onto the network and then use a web server over wifi. Yes I think I might look at doing that :).

       

      Next task is to pace the data being output from the serial port, chop it into chunks and add the required Smartsocket header '$B7M' and so on, and then write a string handler routine which performs the scrolling.

       

       And then maybe I'll post a video on Youtube showing how it works on the six  16 segment LED displays I'm using which run the standard B7971 Smartsocket code on their controlling PICs.

       

      Chris

       

       

       

       

       



      ---In smartsockets@yahoogroups.com, <rich@...> wrote:

      Great work!

      Even though it's not as fun as programming microcontrollers, you can do a lot more with a real operating system...

      Speaking of which - you could allow configuration of your device by running a web server on the pi and having the customer use their PC browser to connect to the pi and do the config that way.

      Rich


      On Wed, Oct 2, 2013 at 7:03 PM, <fixitsan@...> wrote:
       

       

      Tonights challenge was to capture the received RSS feed from the BBC and save it in a file. That turned out to be pretty trivial, so I moved onto playing with the serial port and succeededin capturing the RSS data, scraping out the 'item', 'title' and 'description' tags, and then sending the resulting data (all from one massive string) to the serial port, where my Pickit 2 which was hooked up to my PC running Hyperterminal (at 9600 baud) caught it all as follows.....
      If it gets mangled by Yahoo, the original format is pubDate, CRLF, Title, CRLF, Description, CRLFCRLF
       
      Wed, 02 Oct 2013 20:26:30 GMT
      Tories may cut under-25s' benefits
      David Cameron suggests that out-of-work benefits paid to people under the age of 25 could be cut so all of them are either "earning or learning".
      Wed, 02 Oct 2013 22:25:34 GMT
      Obama warns of US default danger
      President Obama meets Congressional leaders for talks on the US shutdown after warning Wall St should be concerned about the risk of default.
      Wed, 02 Oct 2013 22:45:43 GMT
      Jackson promoters AEG Live cleared
      A jury finds Michael Jackson's concert promoters, AEG Live, not guilty of negligence in hiring the doctor who killed him in 2009.
      Wed, 02 Oct 2013 17:12:22 GMT
      Spy novelist Tom Clancy dies aged 66
      Best-selling US author Tom Clancy, known to millions for his Jack Ryan series of novels, has died aged 66, his publisher confirms.
      Wed, 02 Oct 2013 15:24:05 GMT
      Man detained for random bus killing
      A man whose mental health was the subject of warnings is detained for killing schoolgirl Christina Edkins in a random attack on a bus in Birmingham.
      Wed, 02 Oct 2013 20:31:47 GMT
      No need for Mail apology - Gove
      Education Secretary Michael Gove defends newspapers' "right to offend" as the row between the Daily Mail and Ed Miliband continues.
      Wed, 02 Oct 2013 18:47:46 GMT
      Letta wins after Berlusconi U-turn
      Italian Prime Minister Enrico Letta wins a Senate confidence vote after a last-minute U-turn in his favour by former PM Silvio Berlusconi.
      Wed, 02 Oct 2013 16:41:04 GMT
      Gun 'not planted next to Duggan'
      A firearms commander tells an inquest "it is outrageous" to suggest he planted a gun near the spot where Mark Duggan was shot.
      Wed, 02 Oct 2013 17:24:31 GMT
      FBI arrests Silk Road site suspect
      The FBI says it has arrested the suspected operator of the Silk Road - a website used to buy and sell drugs and other illegal materials.
      Wed, 02 Oct 2013 21:07:58 GMT
      London top city in university table
      London has more universities in the top 40 of a global league table than any other individual city.
      Wed, 02 Oct 2013 14:42:55 GMT
      Mother 'drank as son wasted away'
      A mother accused of the manslaughter of her son sat drinking vodka as he "wasted away", the prosecution claims.

      ---In smartsockets@yahoogroups.com, <fixitsan@...> wrote:

       


      Thanks Rich
      >
      I'm not sure how you would deal with the API keys problem - that's a good question.  I guess asking the user to register on the first use would be a good option.
      Rich
      >
       
      I am wondering about the possibility of automating the process !
       
      For a user interface I thought about attaching a few buttons to the Pi's GPIO. Using these buttons a user could enter their Twitter username and password which could be displayed on the smartsockets. Once transmitted to the Twitter API website the key could be retrieved by scraping the returned page for the key information, stored to a local file and then included in the host application.
       
      This is just off the top of my head though, I need to go through the motions with retrieving a key first !
       
      Chris


      On Tue, Oct 1, 2013 at 2:22 PM, <fixitsan@...> wrote:
       

       

      Yah, but yoiu know the problem now. Featurecreep.
       
      If I use f = urllib.urlopen('<RSS feed url from the BBC>'), and then scrape through the returned file for incidences of '<item>' I can easily get RSS feeds working too.
       
      And the problem with that is there are different flavours of script languages being used for RSS, so I need to make sure that I capture the header, and then , hopefully, there might be a Python module already built to deal with it !
       
      Chris
       
       
       
      sounds great..cant wait till it functions on a smart socket array...kp couch
       
      In a message dated 10/1/2013 10:55:46 A.M. Pacific Daylight Time, fixitsan@... writes:
       

       

      No I didn't need to go that far Rich. Opening Python 2.x with IDLE (not Python 3.x with IDLE3) I just used the inbuilt 'urlopen'
       
      As long as the public feed is accessible without logging into Twitter, IE it is available through a regular browser without logging into Twitter, EG https:// twitter.com/bbcnews , then URLLIB does all the SSL stuff required.
       
      I used ..
       
      import urllib
       
       
       
      f = urllib.urlopen('https://twitter.com/bbcnews')
      print (f.read())
       
       
       
       
      OKay, including the line 'import urllib' then it's 3 lines of code
       
      Replacing'BBCNews' with 'NYTimes' also works.
       
      The caveat, apparently, is that SSL isn't checking security certificates using this method
       
       
      Chris
       
       
       
       
       
       
       
      Are you calling an eternal executable to get the twitter feed, or did you register an app with twitter and connect yourself using the twitter API? (can't imagine you could do that in two lines of code, though)...

      If you are worried about someone getting your source code, use a compiled language instead of Python.

      Rich



      On Tue, Oct 1, 2013 at 9:30 AM, <fixitsan@...> wrote:
       

       I've gone from a RF 802.11 module + pic + sd card + breadboard + hundreds of lines of difficult code

       

      To A Raspberry Pi, and 2 , TWO, lines of code.

       

      In fact, I am able to get an HTTPS (secured with SSL) off a public Twitter feed, www.twitter.com/bbcnews , and send the output straight to the screen.

       

      But with a few more lines the Twitter page can go straight to a file for processing and scraping.

       

       

      I think that this is the way forward for me, at least for now. A model 'A' Raspberry Pi board costs £22 (+vat), when you add the £5.50 for the wifi dongle it still comes in at under £30. That's probably less than buying the microcontroller solution I was previously working on.

       

      RaspPi's only disadvantages are that it's larger and the code cannot be secured (flashed onto a chip with protection bits set), Neither of those are too offensive considering the opportunities it brings in return.

       

      I like the fact that I can just 'get on with programming' without getting too tied up with the technicalities. It sort of reminds me of when I used to spend hours writing shareware for the Psion Organiser using OPL. Python seems just as good at getting the job done.

       

       

      Hehe, 2 lines of code versus over 1000 !

       

       

       

       

       

       

       

       

       



      ---In smartsockets@yahoogroups.com, <michail1@...> wrote:

      I have been mining Bitcoin using raspberry pi's for a while.
      I can confirm that memory cards make a huge diff.  (So, I keep several with images pre-setup just in case they go bad.)  Strangely, I have the worse luck with Sandisk.
       
      I typically don't use with monitors, but when I do, I use the cheap $7 HDMI to VGA adapters.
       
      Next time you buy a pi, just add the $5 to get the 8GB card with it.  Cheaper than you can buy in a store and come loaded with the OS'es preloaded.
       
      Michail
       
      In a message dated 9/26/2013 4:07:10 P.M. Pacific Daylight Time, fixitsan@... writes:

       Hello from my Raspberry Pi !


      I have to say that I didn't expect to have so many problems with SD Cards from different manufacturers, But in the end I've booted up successfully  from an old Sandisk 2GB.


      Wifi installation was painless, and I'm reading this back in a browser window displayed on my monitor via it's DVI input through an HDMI to DVI cable, between the monitor and the Pi.


      In one USB slot is the small wifi dongle, in the other USB slot is my industrial keyboard with built in mouse.



      I've rebooted a couple of times and the hardware comes up well each time so I'm on the way now. I've never touched python, I had a couple of African pythons as pets when I was a teenager but thats about it !



      So now I need to do some research and start playing about.....hoping for a quiet day at work tomorrow, but at least the weekend is here anyway :)



      Chris




    • Show all 62 messages in this topic