Skip to content

Author: Simon Cedergren

C.H.I.P Headless setup over Serial on Linux

So finally I got my C.H.I.P SOCs after waiting for at least half a year.

The computer comes with no means of connecting it to a display, which I realized to be a problem once a discovered the lack of an Ethernet port as well. However, it is possible to connect over serial through the micro-USB port.

To be able to SSH into the C.H.I.P, we need to setup a wireless connection, install an SSH server and start it.

  1. Connect the C.H.I.P to your computer and make sure that it’s LEDs keep on flashing. I used a bad USB cable that stopped working soon after boot, which caused some head ache.
  2. Look at dmesg to find out which port the C.H.I.P uses. It will be something like /dev/ttyACM0or similar. Use dmesg | grep tty for some filtering. Reconnecting the USB cable will produce the output again.
  3. Install minicom: sudo pacman -S minicom
  4. Run it with minicom -s
  5. Go to Serial port setup and set Serial Device to point at the device you found in step 2, e.g. /dev/ttyACM0. Set the Baud Rate (Setting E) to 9600. Press Escape twice.
  6. Now you’re in! Sign in with user chip and password chip. Go ahead and get root access with sudo su. Use the same credentials.
  7. Use nmtuito connect to your local wireless network. It’s a pretty user friendly CLI utility.
  8. Install an SSH server; apt-get install ssh. Activate it with service ssh start.
  9. Get the IP address from ip addr. It’s the wlan0 interface you should be looking at.
  10. Try to connect to the C.H.I.P over SSH; ssh chip@<the IP found in step 9>:22. Now you’re in!

Bonus: The C.H.I.P fits nicely in a Scotch-Brite!
299151480370660061299131480370595175

 

Greed for Android

One of the assignments I was given this summer was to implement a version of Greed (otherwise known as Farkle, according to Wikipedia). I have now published it to Google Play Store, here.

I suspect that the rules for this version of Greed was a bit simplified, since this course focuses on Android development and not game logic.

In short; get 10.000p in as few rounds as possible. If you choose to Greed, you get the chance to throw some of the dice again but risk losing the whole rounds’ score.

Screenshot_2015-07-16-08-28-01   Greed
…and here is Greed! I decided to implement Google Play Game Services as well. There are five achievements and a leaderboard for now.

Though Greed is a rather small app, a few libraries have been used to make the development a bit smoother.

  • Timber – This is a (really) small library that makes logging a bit more enjoyable, especially when combined with Pidcat. It handles tags for you and makes it easy to toggle output, so you don’t log in production.
  • Butterknife – Butterknife primarily handles view inflation, and that is why I decided to try it out. Instead of having to type “Button btnGreed = view.findViewById(R.id.btn_greed)“, you just declare a field variable and annotate it: “@Bind(R.id.btn_greed) Button btnGreed“. Beside view inflation, Butterknife also handles click events and other “boilerplate-heavy” things.
  • Otto – Otto is a simple event handler. It makes it easy to communicate between Activities and Fragments. In Greed I have used it to internally notify about unlocked achievements, since the fragment handles the dice and the activity handles Google Play Game Services.
  • Material Ripple – This was pretty much to keep the application compatible with pre-Lollipop devices. Super-easy to implement. It is used when throwing the dice, and covers the whole fragment.
  • Fresco – Fresco is Facebooks’ image library for Android. It is a rather big library, with a lot of functionality. I decided to use it since it made it very easy to play animated gifs (used in the easter egg).
  • Tourguide – Tourguide is used in the introduction tutorial in Greed. It makes it easy to implement a good looking tutorial that forces the user to learn the application, via tooltips, markers and an overlay. It might not be the best UX-strategy, but it makes it so much easier for the user compared to just reading some rules in a wall of text.
  • BaseGameUtils – This is a library used to simplify a lot of interaction with Google Play Game Services. It is made and used by Google and removes much of the boilerplate code otherwise needed to get Play Game Services up and running.

Google Play Game Services has been both easy and fun to implement. Designing and coming up with your own achievements takes some time since they need artwork and have to make sense in game. Implementing a leaderboard should be mandatory for each and every game in Play Store, as it really is a breeze to implement and gives more of an incentive to play and actually get better since you can compare yourself to your fiends.

Enough of this rant.