Arch Flotilla

My Pimoroni Flotilla kit arrived today, and I didn’t have a Raspberry Pi left in workable condition. So, I looked for a set-up that would allow me not to use one. I found a write-up on using Ubuntu and that was hugely useful.

I already had git, so I hit

git clone https://github.com/pimoroni/Flotilla-Daemon-VS.git

in my build area. The daemon is the non-GUI backing that does the hard work of talking to the USB device. It comes without all the dependencies, though. The first one, mentioned in the Ubuntu guide, is libserial. That’s in the AUR. I already had autoconf and libtool. As it happened, I didn’t need to make libserial. This is fortunate, as I found out before I looked in the AUR that pushd was not going to play nicely and I had no idea what that meant.

I also needed libserialport-git from the AUR and websocketpp from the standard repository. I found this out when the makefile borked, and each time there wasn’t a required dependency, I just found it. More than that, I needed to take out the version number in the Makefile. CC = g++-4.9 is probably not allowed because it’s not pure GCC. So, I replaced it with CC = g++ and that worked fine. I swapped OBJECT and LDFLAGS as per the Ubuntu instructions, although I don’t know if that made a difference.

Then I downloaded Rockpool, the interface.

git clone https://github.com/pimoroni/flotilla-offline

That should have run nicely with cd flotilla-offline/rockpool && python rockpool.py but as it happens I have python3 so I made it explicit: python2 rockpool.py and then I was done. Remember to click on Connect rather than waiting politely for the bar to load. You’re acting as a server on the USB connection, so although the address looks like the default, it is and it should be.

Learn C the Hard Way – Making and making and GNUmaking and throwing things across the room

Ex 2 of Learn C the Hard Way introduces how the makefile works. I’ve tried and failed to use this before, when trying to make an Arch package, so it’ll be good to work out how to do that. I’m not looking forward to failure, of course. This blog is basically a lie.

emacs Makefile

and I created the file as I was told to. My ex1 still has

#include<stdio.h>

in it, so it didn’t throw up any warnings, but when I commented that line out, it did. So my computer’s now in much the same state as what Zed was using to write, and I’m not getting my compiler screaming where his wasn’t. I did have to read down his page to a note saying that he had an unfixed ex1, but I was pretty sure that’s what had happened. I’d put that note up at the top.

If I have two tabs instead of none, I don’t have any errors thrown. This is unlike Python’s unexpected indent. I wonder why it needs an indent at all, but I’m going to go with BECAUSE and ignore that for the moment.

I had to go looking for more information for extra credit. According to
www.cs.colby.edu/maxwell/courses/tutorials/maketutor
‘make’ on its own will execute the first command in the file. So, my first attempt at putting all: ex1 into the file was after clean: and it didn’t work. My second attempt had line breaks, which was a guess at how to separate functions. I then went without separating functions at all. -o is a flag that should take one file name, and then the next bit of info should be separate by default. And whaddyaknow, this works. I have, readers may have noticed, a way of making things difficult for myself, mostly by assuming they will be more complicated than they actually are.

I’ve decided I want to add -d to the makefile flags, if that does what I think it will. I like debugging info.
-o seems to mean we’ve got an old file, which is… odd. So it must be that the internal makefile syntax and the syntax we use to call it are different. It sort of makes sense.

man make

has a typo in it.

$ man cc

– no manual entry for cc. Yerwhat? I assume cc is the c compiler…

$ which cc

– /usr/bin/cc . So I have it. I just don’t have a man page.

$ man -k '^cc$'

– nothing appropriate. This isn’t about an adult filter, either. This man page isn’t in my distro. So, over to

https://www.ma.utexas.edu/cgi-bin/man-cgi?cc+1

to get my fix. And aaaah. ‘gcc’ exists.

$ man gcc

– Result! And wow, that’s complicated. I mean, that’s a whole set of stuff that I could do, with huge options lists I can’t (yet) hope to comprehend. But here I am failing in public, so let’s look at the last bit of the Extra Credit. I don’t know what ‘better’ means in this case, for a future case of what a Makefile does.

Online research – http://mrbook.org/blog/tutorials/make/ is helpful. It’s coming from the angle of people who can code and want to automate it, but it’s still explaining things simply. all: is a default. Anything after the colon is dependencies. I think this should be expanded and explained more. I’m not getting it from Zed’s explanation, and a couple of sentences there would have made the first part of the Extra Credit much easier to understand. I think I’m learning too far ahead of things, though. I went back and stopped ex1 from being a dependency of all: and that’s where I’m leaving it. I’ve cruised through a few examples, but there’s too much to hold in my head to stay here. I need to move on and see how it works.