Thanks for that, Rich. I ve had a couple of days to look around and see that umpteen Pi based solutions are extant. They look easy enough to modify. MyMessage 1 of 62 , Sep 22View SourceThanks for that, Rich.
I've had a couple of days to look around and see that umpteen Pi based solutions are extant. They look easy enough to modify. My reluctance to use something so powerful and flexible as a Pi is that it is complete overkill when all I'll be doing is clocking data in and out, making nothing more than a selective buffer with conditional actions !
The Pi won't arrive until tomorrow, but I'm still thinking about how to make a micro based solution with all firmware on the SD Card, because these self writing micro's can be so versatile in that respect.
Ultimately I think I'll go for the Pi idea, if for no other reason than to get 'up to date' (!) and I'll leave the micro idea as a deep thinking exercise. For some stupid reason I get attracted to interesting problems for single chip solutions.
But I understand that it's not everyone's cup of midnight oil, and I appreciate that to the majority of end users 'as long as it works and keeps on working' is all that really matters :)
--- In firstname.lastname@example.org, Rich Gopstein <rich@...> wrote:
> It's a very different environment than programming a microcontroller, but
> for some things, microcontrollers are not the right solution.
> Let me know if you need any help.
> On Fri, Sep 20, 2013 at 1:57 AM, fixitsan2 <fixitsan@...> wrote:
> > **
> > I've just pushed the button on buying a new Raspberry Pi.
> > I've only had limited success with using an Arduino and ethernet board - -
> > the ethernet port and SD card are on the same SPI..... so no way to buffer
> > the ethernet data straight to SD card...
> > The homespun method of programming my own pic is more reliable and
> > possibly the least expensive method (by just a few pounds).
> > However, I would like to make it possible to receive Facebook, Twitter,
> > RSS and so on. To do this is much easier with a RPi, but importantly I
> > think the interfaces to those apps are going to change from time to time
> > over the years, which would mean that if I hardcode my application then
> > there is the possibility of some of it becoming obsolete quite quickly.
> > By using the RPi the whole operating system and support files are held on
> > a single SD card and can be updated whenever required, easily, hopefully
> > keeping obsolescence at bay.
> > I've read up about the serial port of the Pi and it seems fairly trivial
> > to implement it....so I guess I need to learn some Python and brush up on
> > Linux !
> > Chris
A quick update. I ve been playing with system stuff on the Raspberry Pi, with the aim of producing something which can work headless - IE no monitor orMessage 62 of 62 , Oct 8View Source
A quick update.
I've been playing with system stuff on the Raspberry Pi, with the aim of producing something which can work 'headless' - IE no monitor or keyboard requiredI've just about worked out a way so that the user needs to only plug in a USB memory stick with a file int he root directory called 'wifi.txt' , which should contain the wifi ssid and password.Further files on the stick can be used to upload the desired RSS feed URL's and a control file to dictate how often the feeds should be checked.The idea of a server being included to allow you to change these configuration settings via your laoptop.pc.mac or possibly mobile phone is attractive and currently I'm testing some small http servers. I've loaded up the Apache server and it works but it's just way ott, there are simpler and options availableI've also managed to save the sd card image which I will use for this project which will mean that it ought to be possible for someone to burn the image to an SD card and plug it in, for true plug and play functionality (once the unit knows the wifi password from the usb stick)I had thoguht of targetting the model A Pi because it's cheaper, but the model B's have just become available for £24 incl p&p which makes ethernet operation feasible at such a low price.As well as making B7971/zm1350 and IV-17 smartsocket versions, I've also been in contact with a company called Embedded Adventures who are looking to produce a version of their popular 8 x 80 led matrix display as an output device.Very busy with the day job and my electric motorcycle project at the moment too, but enjoying playing with the Rasp Pi very much indeed.Chris---In email@example.com, <firstname.lastname@example.org> wrote:I've fixed the puctuation issue by adding some punctuation characters in the valid character table of the B7971 code.The memory use is almost at it's maximum but there don't seem to be any issues, because it all works well.I probably won't give such frequent updates in the coming days, there's quite a lot I need to do now but it's all structure and file handling stuff which is mundane but needs to work properly. I thought the hard part would be getting the hardware to work for me but that's been good fun and the code for that has been quick to develop.I also know that some RSS sites use a slightly different page delivery format to the BBC one, so I need to look into the different flavours of RSS XML to make sure I can get them all to work as well as I would like.Naturally there'll need to also be an IV-17 version, probably for 8 tubes ( but 4 tubes could be user set preference)I need to get a remote control working, but having taken up the only UART tx/rx connections available on the Pi I'll need to go either SPI or I2C for that. At a glance I might need to use a microcontroller after all, to make an I2C>UART bridge to allow me to use one of the cheap bluetooth modules, such as the HC-06 variety. But then again I can remember seeing some cheap wireless remote controls whcih output 4-bit codes to 4 GPIO pins, so that's a possibility.---In email@example.com, <fixitsan@...> wrote:
If I could just now, I would.
Here's the code though. (Only about 50 lines !)CODEimport urllibimport serialimport timeser = serial.Serial()ser.port = "/dev/ttyAMA0"ser.baudrate = 9600ser.bytesize = serial.EIGHTBITS #number of bits per bytesser.parity = serial.PARITY_NONE #set parity check: no parityser.stopbits = serial.STOPBITS_ONE #number of stop bitsser.timeout = 1 #non-block readser.xonxoff = False #disable software flow controlser.rtscts = False #disable hardware (RTS/CTS) flow controlser.dsrdtr = False #disable hardware (DSR/DTR) flow controlser.writeTimeout = 2 #timeout for writeser.open()ser.write(chr(10))time.sleep(2) #pause 2 secsser.write("$B7E000000"+chr(13)+chr(10))time.sleep(1) # pause 1 secf= urllib.urlopen(u)contents = str(f.read())f.close()i=0ff = open('rssout.txt','w')while True:i = contents.find('<item>',i)if i == -1:breaki= contents.find('<title>',i+1)j= contents.find('</title>',i+1)message_title = contents[i+7:j]i= contents.find('<description>',i+1)j= contents.find('</description>',i+1)message_description = contents[i+13:j]i= contents.find('<pubDate>',i+1)j= contents.find('</pubDate>',i+1)message_date = contents[i+9:j]ff.write(' BBC ')ff.write(message_date+' ')ff.write(message_title+' ')ff.write(message_description+' '+chr(10))ff.close()f = open('rssout.txt','r')contents = f.readline()while contents !='':print(contents)l = len(contents)for i in range (1,l-6):ser.write("$B7M"+contents[i:i+6].upper()+chr(13))time.sleep(0.2)contents = f.readline()f.close()
---In firstname.lastname@example.org, <Thinwing@...> wrote:
I WANT!...GIMME...kpcIn a message dated 10/3/2013 3:15:32 P.M. Pacific Daylight Time, fixitsan@... writes:
After a bit of playing, I present the Raspberry Pi/Smartsocket RSS reader
Making this has highlighted a few problems with the existing Smartsocket code. First, there are no lower case characters so I have to convert nice mixed case messages into all uppercase.
Another problem is that when there a bit punctuation comes along and you're trying to scroll it, there is a clash between the code trying to ignore the invalid punctuation and trying to display the last character. That is why in the video there are occasional double characters at the end of some words.
The Raspberry Pi TX pin connects via a 220Ohm resistor to the Smartsocket, as a precaution towards problems caused by the difference in system voltages , Raspberry Pi at 3.3V and PIC/Smartsocket at 5V.
I'm happy to have got this far and really pleased with Python as a language. So far this is just a proof of concept. Now the real work begins because somehow users need to interact with the unit. For example, if you see a feed scrolling past which you've read already, or which isn't of interest, then you ought to be able to perhaps press a button on a remote control to allow you to jump to the next message. Or maybe yoiu want to see the time ?
The method of operation is roughly as follows..
- Read the whole RSS page in XML format into one long string (Python seems to be able to cope with massive string lengths)
- Step through the string till the <item> tag is found , and then capture the date, time, Title and description...and then write that group of data as a single line in a text file (rssout.txt)
- Once the file is written, the lines are stepped through, one at a time. Each line is read 6-characters at a time and that 6 character wide window is scrolled along, step by step, and appended to a Smartsocket $B7M header.
Anyway, getting this far proves the hardware side of things, as well as proving that Python, Raspberry Pi, Raspbian OS and a wifi dongle all work well together. I haven't had a single website connection failure or a single wifi problem, so I'm really pleased with the reliability and robustness of this system.