Hmmm, pi...

Well, it's been a fun couple of weeks (well, hours...many hours) trying to get the raspberry pi to get to work with my original openFrameworks program. Setting up OF on the pi wasn't that hard really - but I began to realise that debugging when the inevitable problems arose would be quite a long process, if only because compilation time is so much longer on the pi. No, I have not successfully created a cross-compiler yet. I guess I kind of figured that my program really wasn't that complicated - how much could go wrong? Well, it seems, enough. Enough so that the program just will not run the way I expected it to. The first issue was that the 'ofVideoGrabber' function, which is openFrameworks built in function for dealing with video streams, doesn't work with the pi's native camera (as described in the last post). This seemed to be working OK, but there were some quirks when setting the resolution (the normal vidGrabber is very forgiving in terms of aspect ratio for example - you can display as a square if you want with no problems apart from the inevitable image warping), where segmenting the dimensions to fit properly on the screen just didn't seem to work as I might have expected. Then there was the fact that the program runs reallllly slowly. But at least it runs, sort of. The printer indeed printed as per the press 'p' to print function, though this did not work as well as it did on the laptop. I also spent three hours or so today trying to setup the piVidGrabber a little differently using something called 'OMX' optimisation. I actually have no idea what this is but I was looking for ways to speed up the program so I followed some of the code which came with the examples of the add-on. Admittedly I didn't feel on top form today after a fairly heavy weekend, but I just could not get the OMX thing to work. Can't fault the creator though for being increbibly throrough with the examples provided as well as keeping the add-on up to date with the latest version of OF and raspbian stratch, without this add-on I don't know if I'd be able to use the pi camera at all! For the final setup though, I need to be able to set the printer on a timer, where it prints what I want it to say every x minutes. This I should have tested with my original program on the laptop - the way I did it within the 'draw' function just threw up a bunch of segmentation errors and the program would just crash whenever the timer hit it's end point in order to start counting again. I've now created an actual timer function which I'm hoping will be the solution I need - now just the slightly tedious process of setting everything up on the pi to see that it works! I could of course see if this function does work with the program running on my laptop which I know works well and that my logic in creating a function is sound...I may yet do this but for the meantime I've just created a new git branch of the pi version which I will test tomorrow. I guess I kind of lured myself into a false sense of security by thinking that this project would be pretty straightforward, which in theory, it is - but practice will often prove ones assumptions wrong! As such, I am not quite at the level I would like to be at this stage - I thought I'd be pretty much finished by now but alas, it is not to be, yet. Hopefully I can update soon with something a bit more like progress!