Project – Blog. by Next Thing https://ntcblogbackup.wpengine.com News & Notes. Process & Projects. No BS. Srsly. Thu, 09 Nov 2017 03:16:07 +0000 en-US hourly 1 https://wordpress.org/?v=4.9.5 Be the Boss with PocketC.H.I.P. Karaoke https://ntcblogbackup.wpengine.com/be-the-boss-with-pocketc-h-i-p-karaoke/ https://ntcblogbackup.wpengine.com/be-the-boss-with-pocketc-h-i-p-karaoke/#respond Tue, 06 Jun 2017 15:24:21 +0000 http://blog.nextthing.co/?p=1532

No need to wait for your song to come on at the local karaoke joint anymore. You can now queue up all those hair metal ballads, Britpop hits, and good ole American heartland rock ‘n’ roll you’ve dreamt of belting out with your friends on PocketC.H.I.P. Karaoke!

I ❤ karaoke. It brings so much Satisfaction and adds to my Lust for Life. Whether you are in Funkytown, the local dive bar (you know the one) or a Love Shack, it always livens up the party. When I found Pykaraoke in the Debian repositories, I knew this was the software PocketC.H.I.P. was Born to Run.

The best part is this build takes a minimal investment of energy with a maximum return of good times. Enough chit chat, Let’s Get It Started!

Materials


  • 1. Setup USB Sound Card

    Plug in the USB sound card, your speaker (or a pair of headphones) and the microphone. Fire up Terminal and open AlsaMixer:

    alsamixer

    Here you can manage the USB sound card and any devices plugged into it. Following the menu at the top, press F6 and select your USB sound card. Mine is called C-Media USB Audio Device… very descriptive. Toggle the speaker and mic on and off by pressing m. Use the up and down arrows to adjust the volume levels to your liking.

    When everything sounds good, exit AlsaMixer by pressing Esc.


    2. Install PyKaraoke

    If you aren’t already, connect to a WiFi network in PocketC.H.I.P.’s settings (hit the gear in the lower right corner of the screen).

    On Pykaraoke’s website the author lists different ways to install Pykaraoke depending on the OS you’re using. For PocketC.H.I.P.’s Debian based image I found it easiest to use apt-get to install it and all it’s dependencies.

    sudo apt-get update
    sudo apt-get install pykaraoke -y

    Note: If you do download and install the dependencies as instructed on the website the package listed as libwxgtk-python has since been updated to python-wxgtk3.0.

    That’s it! Pykaraoke is ready to use. Your karaoke dreams are close to coming true. To start the application type:

    pykaraoke


    3. Upload Karaoke Songs to PocketC.H.I.P.

    Pykaraoke can play several different file formats designed for karaoke machines. I mostly used CDG and MIDI formats. CDG files can be purchased online and you can download MIDI files from various online sites for free.

    Pykaraoke also has a suite of tools that manage CDG files and even has a utility to create your own playble files from CDG discs. It makes for a good excuse to go hunting for karaoke CDs at your local thrift store.

    Once you have acquired a collection of song files it’s easiest to upload them by connecting to PocketC.H.I.P. via SSH from a host computer then transferring them using an FTP client like FileZilla. To SSH into PocketC.H.I.P., you first need to install a tool that will enable you to remotely connect such as OpenSSH.

    sudo apt-get install openssh-server

    To connect via SSH to PocketC.H.I.P. you need it’s IP address. Use the following command and find the address:

    ip addr show wlan0

    Next, create a directory for all your karaoke songs to live in:

    mkdir ksongs

    Open your FTP client and plug in the IP address a.k.a. host, username, password and connect. Transfer all your glorious song files into your new directory.


    4. Load Songs in Pykaraoke

    Pykaraoke has a convenient feature of creating a searchable database. All you need to do is tell Pykaraoke where to look. There are two ways to load songs: either by searching for a compiled database or by navigating to song files and loading them manually. By default, Pykaraoke will open in Search View which will be indicated in the upper right corner.

    To create a database navigate to File > Add New Songs to Database.

    A window that is not sized correctly will open. You will not be able to see the option of adding a directory for your database, but you still can! Hit TAB once and press Enter. This will highlight and select the option you can not see.

    Another window will pop open, this is where you navigate to your song directory. After you’ve done that, click Scan Now which will scan for karaoke files and compile a database of found songs. Then click Save and Close.

    Now when you type an artist or song title and press Search any songs that match your keywords will pop up. Add a song to your playlist by highlighting it and clicking Add to Playlist. If some of the buttons are hard to see or cut off, drag the middle bar right or left to adjust the size of the search and playlist windows.


    5. Press Start and Sing Your ❤ Out

    Add as many songs as you like. To start the playlist highlight the first song and click Start. Pick up the mic and get ready!

    When you are done (which you never really are with karaoke) hit Esc to stop the playlist.


    What’s your favorite way to karaoke? Let us know in the comments below. Plus, make sure to tweet us your favorite photos from your very own PocketC.H.I.P. Karaoke sessions, and don’t forget to join the conversation in the forum.

]]>
https://ntcblogbackup.wpengine.com/be-the-boss-with-pocketc-h-i-p-karaoke/feed/ 0
Light Up Your PocketC.H.I.P. Cyberpunk Style https://ntcblogbackup.wpengine.com/light-up-your-pocketc-h-i-p-cyberpunk-style/ https://ntcblogbackup.wpengine.com/light-up-your-pocketc-h-i-p-cyberpunk-style/#comments Fri, 26 May 2017 19:08:41 +0000 http://blog.nextthing.co/?p=1491

In the wake of Cyberpunk Your Summer campaign, we’ve been repeatedly asked one question: How do I make my PocketC.H.I.P. glow like that? By popular demand, here it is, your Cyberpunk PocketC.H.I.P. LED & El Wire tutorial!

I had seen the EL Wire PocketC.H.I.P. project by Pocketeer 5t4rw1nd in the forums and decided to give it a go. It was rad, but I needed a bit more case illumination for our planned night time cyberpunk photoshoot. That’s when it hit me. I made a few tweaks and threw LEDs into the mix. With the combination of EL Wire and LEDs the hack really took off. Plus, I used a power inverter and DC step-up, so I made it all glow using only PocketC.H.I.P.’s internal battery.

Materials

Note: The step-up is for the 12V LED strip which can be powered by as little as 9V, though it will be dimmer. The adjustable module is a handy dimmer for the strip, or you can purchase a step-up module that supplies a steady 9V-12V. The LEDs will pull about 170mA, so any module that provides 1A output is more than enough.

  • Double-stick tape such as VHB (foam and otherwise)
  • Wire – the thinner the better

Tools

  • Soldering iron
  • Power drill and 764 bit
  • Small flat-head screwdriver
  • Wire snips and strips
  • X-Acto blade

1. Prep LED Segments

Cut on the line between the solder pads.

Cut the LED strip into segments of 4″ which will give you 12 LEDs per section. With an X-Acto knife carefully cut the very end of the plastic casing off to expose the two solder pads. You only need to cut it away on one end. The strip is thin, and the pads are fragile so be careful going in with a sharp blade.

Lift up and cut plastic from solder pads.

Ready to be soldered to wires.

2. Solder Step-up and LEDs to PocketC.H.I.P.

Make sure the wires are long enough for each segment to reach to the front.

Solder these connections:

LED strip 1 power ↔ LED strip 2 power
LED strip 1 ground ↔ LED strip 2 ground
LED strip 2 power ↔ Step-up VOUT+
LED strip 2 ground ↔ Step-up VOUT-
Step-up VIN+ ↔ PocketC.H.I.P. 3V
Step-up VIN- ↔ PocketC.H.I.P. GND

Solder strips to VOUT and 3V and Ground pins to VIN.

3V and Ground pins on PocketC.H.I.P. are used as power source.

3. Extract Inverter

Carefully pry open battery holder to get to inverter.

Use a small flat-head screwdriver to pry the inverter case open. Be careful not to damage anything, including yourself! Take out the inverter and take note of the two connections that go to the battery for DC input and the two output wires that will connect to the EL wire.

Use a pair of angled cutters to snip off the ground coil and wire that connect to the battery holder. Place the inverter on the back of PocketC.H.I.P. to get a sense of how long the output wires should be. You want to make as much room as possible in the back so keep wires as short as possible. When ready, shorten the output wires that will connect to the EL wire.

Tip: Mark the wires before you forget which one is ground and which is power.

Clip off negative and positive input leads and trim the length of output wire.


4. Solder EL Wire and Inverter to PocketC.H.I.P.

Solder EL Wire to the output of the inverter.

Splice two wires in with PocketC.H.I.P.’s GND and 3V that are wired to the DC step-up. Solder these wires to the input of the inverter, where the battery used to be connected. Then, solder the EL Wire to the ouput wires, in my case these are the two black wires.

Note: The inverter transforms the DC power coming from PocketC.H.I.P. into AC power that the EL Wire runs on. The inverter used here is made for one AA battery which is 1.5V, but it also works with 3V. I used the 3V output since PocketC.H.I.P. makes it conveniently accessible.

Solder these connections:

EL Wire power ↔ Inverter power out (black wire)
EL Wire ground ↔ Inverter ground out (black wire)
Inverter ground in (where the battery coil was) ↔ PocketC.H.I.P. GND
Inverter power in (where the white wire was) ↔ PocketC.H.I.P. 3V

The power and ground pins go to both the inverter and step-up.

Solder power and ground to the input of the inverter.


5. Downsize Battery (Optional)

Downsize battery to make more room in back.

This step is optional but recommended because it makes more room for the EL Wire and modules. You will find that for everything to fit under the back case you will need to move around parts and use your best puzzle problem-solving skills. If you have a smaller battery lying around I recommend using it. I put in a 1000mAh LiPo instead of the stock and it’s lasted at least an hour with lights on and playing games. You may even want to use a smaller diameter of EL Wire although the high-bright variety is recommended. You can find EL Wire diameters as small as 2.1mm.


6. Snip the PocketC.H.I.P. Bezel

Snip off the upper right and lower left (when the bezel is on PocketC.H.I.P.) tabs with angled cutters. This will make room for the LED strip wires to reside.

Clip off one tab on the bottom and one on the top of the screen to make room for the LED strip wires.


7. Attach LED Strips to Front

Position LED segments right above and below the screen and tab holes.

To keep the wires in the back of the PocketC.H.I.P., the LED segments get pushed through two of the holes the screen frame snaps into. Use strong double-stick tape, like VHB, to attach the segments to the front above and below the screen.

Stick the strips down with a strong tape like VHB.

Thread one LED segment through a tab hole below the screen and one above the screen.

Push the wires out of the way of the pins once the segments are fixed to the front.


8. Install EL Wire

Stick the EL Wire down to the board with cut strips of VHB.

Use strips of VHB (or strong tape) to attach the EL Wire to parts of PocketC.H.I.P.. Don’t be afraid to bend and kink the wire to make it fit around the modules and battery. The randomness of the EL Wire also ends up looking cool.

Tip: The two main areas you want to keep the EL Wire away from are the center of PocketC.H.I.P. above the battery and the area where C.H.I.P. plugs in. Take a look at the back of PocketC.H.I.P. to see where it hits the board and is tight on space to help you plan where the EL Wire can go.

After the EL Wire has been placed, pop the back case back on. Shift things around as needed. The highest part will always be the inverter, but wires can get in the way of the case snapping closed.

Tip: A flat-head screwdriver can be a handy tool to poke wires in with as you snap the back closed.

A beautiful mess.

9. Drill Holes

The output voltage of the step-up is changed by turning a screw which dims the LEDs.

The inverter has a switch on it, which you can replace or extend so that it sticks out of the case. I kept things simple and didn’t do either of those options.

Instead, I chose to use a flat-head screwdriver as a key to all the glowy goodness. I made it so if slip a screwdriver through a small hole drilled into the back of PocketC.H.I.P., I can adjust the screw which changes the output voltage from the DC step-up. Since this build was used in a photoshoot, the fact that the LEDs could be turned up or down was super valuable. Lighting is everything!

Mark where to drill with a permanent marker. Drill using a 764” bit or similar to the diameter of the screwdriver you plan on using. Start from the inside of the case and then come from the outside making sure to get the angle right so the screwdriver can get to the switch and screw.

Mark where to drill with a permanent marker.

The on/off switch can be flipped using a screwdriver.


Going Further

Ready for a challenge? A great way to take this project further would be to control the EL wire or LED strips from C.H.I.P.’s PWM pin.
Tip: Use a transistor with the PWM pin and the external power sources to make sure the LEDs or EL wire gets the power they need while maintaining analog-like control.

chipLogo64x64

Made a EL Wire PocketC.H.I.P.? Take a picture and post them on the forum or tweet at us. And don’t forget to tell us about your favorite PocketC.H.I.P. mods in the comments below. We can’t wait to see them!

]]>
https://ntcblogbackup.wpengine.com/light-up-your-pocketc-h-i-p-cyberpunk-style/feed/ 3
The PocketC.H.I.P. Cyberpunk Adventure Guide https://ntcblogbackup.wpengine.com/the-pocketc-h-i-p-cyberpunk-adventure-guide/ https://ntcblogbackup.wpengine.com/the-pocketc-h-i-p-cyberpunk-adventure-guide/#comments Thu, 18 May 2017 16:00:04 +0000 http://blog.nextthing.co/?p=1472

The Year 2017An underground community of Pocketeers are creating their own cyberpunk future, hacking their PocketC.H.I.P.s far beyond a traditional game console. What follows is a guide to join their ranks. Jack in. Hack the Planet. Dream of Electric Sheep.

Change the Game with PocketC.H.I.P. & PICO-8

The PICO-8 fantasy console features hundreds of free community made games so there’s always a new game to play. But playing a PICO-8 game is just the beginning. Get into the code and change the game, or start from scratch and make your own! Here are some of the best PICO-8 resources to get you coding.


Phase into PocketC.H.I.P.

Thomas rocks the PocketC.H.I.P. with a lanyard strap.

Your cyberpunk summer requires appropriate music. Score your adventures with Phase, a synth created for PocketC.H.I.P. by Humbletune. Making use of PocketC.H.I.P.’s touch screen and keyboard, any Pocketeer can make beautiful music in a matter of seconds. Make your own song of the summer, accept no substitutes.


LAN Party Way the Hell Off the Grid

Cyberdemons are no match for Mitch and Crunch.

Host a LAN Party on your PocketC.H.I.P. and get your game on way off the grid. Battle through hell and back with DOOM in co-op mode, frag each other in Quake III Arena, and play countless other multiplayer classics. No additional cost, no router, no ethernet connection, and no internet required (after installation).


A Scanner PocketC.H.I.P.

Ari’s scanograph shows this log is all bark and no bite.

Go beyond traditional photography and embrace the strange with PocketC.H.I.P. scanographs. Armed with a PocketC.H.I.P. and a flatbed scanner, you’ll be creating images to make your smartphone photographer friends jealous. Welcome to the scanner PocketC.H.I.P.; a community project kicked off by Pocketeer panicrun while on a walk in the woods outside Berlin. Be sure to share your scanographs with us via Twitter. We’re @nextthingco!


Venture into the Virtual

PockulusC.H.I.P. – Strap it to your face!

PockulusC.H.I.P. is Virtual Reality. Breakout of this world by 3D printing a custom bezel for your PocketC.H.I.P. and DIY VR: here’s how. Play all your favorite homebrew Virtual Boy games in glorious monochrome three dee!


Block off time for Minecraft

With Minecraft on PocketC.H.I.P., adventure is in the palm of your hands. Strike out on your own or grab a Pocketeer friend and play cooperatively. You can even create new buildings and terrain with the Minecraft Python API!


Hack a Speaker into your PocketC.H.I.P.

Examining PocketC.H.I.P.’s back, you’ll find a super secret hidden prototyping area perfect for adding a speaker. Designed as a simple intro to hardware hacking, it’s perfect for beginners and takes less than 20 minutes. Get your hardware hack on here

For those looking to go further into hardware hacking, check out klundry’s addition of Qi wireless charging and community case mods here and here. The PocketC.H.I.P. case mod forum post is also a fantastic (and in depth) read.


Blast from Systems Past

Colecovision on PocketC.H.I.P. – One of many emulators the Pocketeer community has running.

Nostalgic Pocketeers can adventure into systems past. With Playstation, Gameboy Color, MacOS and ColecoVision, DOSBox, and TI-99 emulators running on PocketC.H.I.P., you can relive (or explore for the first time) the history of computing, gaming, and calculators.


Make the Call from PocketC.H.I.P.

Tony using a PocketC.H.I.P. cell phone that Dave built

Clever Pocketeers Juve021 and Rob Baruch transformed PocketC.H.I.P. into a cell phone with the addition of an Adafruit cellular module. With well-documented tutorials, you too can make calls from PocketC.H.I.P.. Headphones port included; no dongle required!


Find Your Way with the PocketC.H.I.P. Navigator

Turn-by-turn navigation with navit

Never get lost with the PocketC.H.I.P. Navigator mod. By adding a GPS module to PocketC.H.I.P., you have access to your location, points of interest and turn-by-turn directions without relying on your phone. Learn more here


PocketC.H.I.P. Tweets!

The RainbowStream Twitter client running on PocketC.H.I.P.

Keep up with the Twittersphere with the RainbowStream twitter application by @dtvd88 on PocketC.H.I.P.. With complete configurability and custom themes, you can do pretty much anything you would from a traditional twitter client. Set it up and get your tweet on! (Tag us! We’re @nextthingco.)


Arduino in a Flash

With one simple command, you can turn your PocketC.H.I.P. into an Arduino flashing machine! Great for flashing in the field where a laptop would be unwieldy.


Customize Your PocketC.H.I.P. Home Screen(s)

Pocketeer Marshmallow wrote the de-facto software for adding icons to your PocketC.H.I.P. home screen. Widely used by the community, this is a must for new PocketC.H.I.P. owners. Simply follow Marshmallow’s tutorial and add custom icons for any application you install heretofore. Those looking for more PocketC.H.I.P. software mods can check more tutorials here.


PocketC.H.I.P. & A Galaxy Far, Far Away

Start your Star Wars Episode VIII preparations today by watching Episode IV on PocketC.H.I.P. presented in ASCII, it’s a must watch for any fans of everyone’s favorite space opera. Shout out to Pocketeer Meowter_space for the heads up!


Behind the Scenes

We’ve made PocketC.H.I.P open source so you can make it anything you want or learn how products are made. If you’d like to learn more about PocketC.H.I.P.’s development, complete with unprecedented behind the scenes footage, check out the PocketC.H.I.P. Time Machine .


More Fun on the Forum

These tips are only scratching the surface. There is a ton of fun to be had in the PocketC.H.I.P. forum. The Pocketeer community is always working on new projects and tips like case mods and new software features. Heck, BrianTheBuilder made his PocketC.H.I.P. draw with a robot arm!!! 

Send us your PocketC.H.I.P. Projects!

We love seeing what Pocketeers are up to. Whether its a case mod or a game made specifically for PocketC.H.I.P., we want to know! Tweet at us or post on the forum!

]]>
https://ntcblogbackup.wpengine.com/the-pocketc-h-i-p-cyberpunk-adventure-guide/feed/ 5
Train your PocketC.H.I.P. to Train your Digimon! https://ntcblogbackup.wpengine.com/train-your-pocketc-h-i-p-to-train-your-digimon/ https://ntcblogbackup.wpengine.com/train-your-pocketc-h-i-p-to-train-your-digimon/#respond Fri, 31 Mar 2017 19:19:02 +0000 http://blog.nextthing.co/?p=1465

With some clever hardware hacking and their first python script, NTC forum user directive0 transformed PocketC.H.I.P. into a Virtual Digimon Trainer.

The whole virtual pet phenomenon hit while I was a teenager. Many of my classmates had their Digimon confiscated due to an urgent feeding in the middle of class. Feedings couldn’t be missed. It was always worth the risk. How else were we to ensure our Digital Monsters would be battle ready come recess?

Inspired by a Hackaday article about Sprite_tm’s Infinite Matrix of Tamagotchis, directive0  was determined to automate the Digimon maturation process. Turns out, all that was  needed is a breadboard, a PocketC.H.I.P. and a variable oscillator.

digimon

Busting open the Digimon enclosure reveals a PCB with a handful of test pads designed for testing the unit in the factory. By soldering to these test pads and a bit of wiring to PocketC.H.I.P., directive0 was able to externally control into the Digimon.

digimon-3

To automate training, directive0 learned python to write a Digimon Maturation script. When run, the Digimon is fed, played with, and taken care of automatically. PocketC.H.I.P. effectively became a Digital Digimon Nanny. Not too shabby for your introduction into python.

digimon-2

But directive0 wasn’t just looking to automate the Digimon growth cycle, they wanted to accelerate it. Digimon units use a crystal oscillator as a real time clock. When replaced with a variable oscillator, you can make time fly. With the press of a button, directive0‘s Digimon now grow at ten times the normal rate, hitting a full growth cycle in a day and ready for battle without being a distraction in the classroom (or office).

Dig up your Digimon and give this hack a shot! Join the CHIPster community collaborating with directive0 on the NTC forum.


chipLogo64x64

Are you working on a project with your C.H.I.P. or PocketC.H.I.P.? We want to see! Share your projects on the forum and make sure to tweet at us!

]]>
https://ntcblogbackup.wpengine.com/train-your-pocketc-h-i-p-to-train-your-digimon/feed/ 0
PocketC.H.I.P. Goes to Middle School https://ntcblogbackup.wpengine.com/pocketc-h-i-p-goes-to-middle-school/ https://ntcblogbackup.wpengine.com/pocketc-h-i-p-goes-to-middle-school/#comments Thu, 08 Dec 2016 14:58:06 +0000 http://blog.nextthing.co/?p=1290

Earlier this week, students at West Oakland Middle School learned how to create their own video games using PocketC.H.I.P. and PICO-8!

In honor of Computer Science Education Week, Salesforce.org was hosting three one-hour lessons at a local school and they needed volunteers. Being a newbie to NTC, with admittedly only a little PocketC.H.I.P. experience before my first day of work, I realized I could learn and help at the same time!

Before getting there all I knew about the event was that middle school students would be taught how to code using PICO-8 on PocketC.H.I.P.. And that we would be assisting up to 60 students in one lesson!

At first, that worried me a bit. I have experience teaching hands-on coding workshops and currently teach a semester-long class at California College of the Arts. But the max amount of students I’ve had in those classes have been around 18. This was not only going to be my first time learning how to code on PocketC.H.I.P. but also my first time being around this many young students.

The lessons were lead by the fantastic family duo of Mare and Jessica. Together, they make up Sparkiverse, a group that focuses on after-school programs to creatively introduce kids to STEM. Any worries I had about students not getting their questions answered quickly vanished when I saw how many helpers had shown up to assist the students.

The student’s first task was to create a character sprite (computer graphic in video-game speak) and learn how to display it on their screen. Luckily, I’m familiar with programming, so when it came to helping the students, I could troubleshoot indentations that were missing or loops that were not closed.

But when it came to the PICO-8 interface and how to interact with it I was learning right along with the students. With Jessica’s clear instructions they—I mean WE—learned how to create a background for a sprite to live on and how to move the sprite around with arrow keys.

Some of the students had not coded before and were a bit intimidated at first. But once they typed 3 lines of code and watched their sprite whiz across the screen, they felt excited and encouraged. Coding wasn’t hard. The instant visual result of their code that PICO-8 provided was invaluable to the student’s learning experience. The kids were making games in no time and having a blast at it.

I was surprised and delighted by how many students raised their hands when Jessica asked, “Who has coded before?” I remember typing lessons and trying not to die of dysentery on the Oregon Trail but when I got to middle school there weren’t any programming lessons being taught in the classroom.

For the experienced coders, there were additional steps with the code printed out so they could work ahead. I really appreciated the students having that option since I’ve witnessed varying levels of skills in my own teaching experiences. For more resources on learning PICO-8, check out one of our previous blog posts.

One student from earlier that day was interested in learning more about programming and asked me if he could purchase a PocketC.H.I.P.. We also chatted about how getting better at programming was about practice and having fun. Shortly after telling him he could indeed purchase one Salesforce.org announced that they were donating pocketC.H.I.P.s to the teachers! I was thrilled that the students would have the opportunity to continue to craft their coding skills.

chipLogo64x64

Honestly, I thought teaching younger kids would be scarier than it was. Instead, it was a rich experience where I could teach the kids while they and Sparkiverse taught me. I left imagining of opportunities that would get me back in the middle school classroom. Luckily, I come from the land of PocketC.H.I.P.s and am focusing on education here at NTC. So, watch out C.H.I.P.sters and Pocketeers!

]]>
https://ntcblogbackup.wpengine.com/pocketc-h-i-p-goes-to-middle-school/feed/ 3
Turn Your Pringles Can into an Amazon Echo with C.H.I.P.! https://ntcblogbackup.wpengine.com/turn-your-pringles-can-into-an-amazon-echo-with-c-h-i-p/ Tue, 15 Nov 2016 22:55:13 +0000 http://blog.nextthing.co/?p=413

A while back, Sam Machin built a $10 Amazon Echo using C.H.I.P.! To celebrate the occasion, we all sat around and ate some Pringles chips. Then it hit us! Sam’s project needed an enclosure, and that now empty Pringles can was perfect.

Wasting no time at all, we bundled up all the electronics, Dave got creative with building a nifty cardboard support structure, and we shoved everything inside. The result, Pringles Alexa! Here’s how to build one.

pringles_amazon_alexa_powered_by_chip

Parts

  • C.H.I.P.
  • Pringles can
  • Scraps of cardboard
  • 3.7V LiPo battery
  • Pringles Alexa DIP (see the end of the write-up for the schematic and full BOM)

Tools

  • Soldering iron, solder, and protective eyewear
  • Needle nose pliers
  • Tweezers
  • Hot glue gun and glue

Part 1: Alexa Setup

1. Create an Amazon Developer Account

You’ll need to create an Amazon developer account for this project. Pringles Alexa uses the Amazon Alexa services to interpret voice commands and retrieve answers. Use your laptop and create an account here.

TIP: About half the project steps use the dashboard, so you might want to bookmark it for convenience.


2. Add a New Device

voiceservice

Create a device using the dashboard wizard. Click on the Alexa tab, select Add Device and click on the Alexa Voice Service icon.


3. Name Your C.H.I.P.

dogeinfo

Fill in the Device Type ID and Display Name, with the name of your C.H.I.P., then click the [Next] button.

Each field is case and space sensitive, so pick something you will remember, and that’s easy to type multiple times. We used sandcastle, but you can use whatever name you want.


4. Create a Security Profile

dogesec
Click on the drop-down menu Select Security Profile and select Create a new profile.

Fill out the Security Profile Name with the same name you used on the previous step for Device Name. Enter in whatever you want in the Security Profile Description, then click the [Next] button.


5. Configure the Security profile and Credentials

dogeauthsec

Select Web Settings and then click on the [edit] button near the top right of the page. You need to add the IP address of your C.H.i.P. in the Allowed Origins and the Allowed Return URLs, so click on [Add Another].

In the Allowed Origins enter the following:
http://localhost:5000

Add a second line to this section with your C.H.I.P.’s IP address. You’ll likely have to boot up your C.H.I.P., determine the IP address by typing ip addr show wlan0.
http://10.0.0.100:5000

In Return URL type:
http://localhost:5000/code
http://10.0.0.100:5000/code

Note: Remember again to swap out the 10.0.0.100 for your C.H.I.P.’s IP address.

Save the settings, but keep your browser window open to the security configuration tab. You’ll need to set up some code on C.H.I.P. before you can fill out the Authorization Token field.


Note: That’s all the dashboard setup you need to do right now, but keep this page open. During the setup on C.H.I.P., you’ll need to enter in the long ID and secret strings from the webpage into a C.H.I.P. config file.


PART 2: C.H.I.P. Setup

This project was created on a C.H.I.P. running the 4.3 GUI image. Our newer, 4.4 image implements some changes that are not compatible with this code. As such, you’ll need to flash your C.H.I.P. with the 4.3 GUI. For more information on the differences between 4.3 and 4.4, please see the online C.H.I.P. docs.

1. Install the Required Software

From the Terminal program, update C.H.I.P.’s list of packages by typing the following command, then press enter.
sudo apt update

Install the prerequisite software:
sudo apt install git libasound2-dev memcached python-pip python-alsaaudio mpg321


2. Clone the Git Repository

Sam Machin created this project and hosts his code on Github. To get a copy of his code, you’ll need to use git to clone his repository.
git clone https://github.com/sammachin/AlexaCHIP


3. Install More Required Software

Change directories to AlexaCHIP.
cd AlexaCHIP

Run pip to install some more required software that is not available in the Debian repositories.
sudo pip install -r requirements.txt


4. Configure Device Security

creds

Refer to the Amazon Developer Dashboard page from Step 4 of the previous section and select Security Profile, then General. This will display all of the fields necessary for your C.H.I.P.’s credentials, except for one. Input all the fields available into your creds.py file.
mv example_creds.py creds.py

Then open then file for editing and copy in the strings.
nano creds.py


5. Authorization Token

authtoken
Run python python ./auth_web.py, which starts a webserver on C.H.I.P. used to finalize the security credentials with Amazon.

On your laptop, use a web browser to visit C.H.I.P.’s IP address at port 5000. For example, I directed my web browser to 10.0.0.100:5000. Then enter in your Amazon username and password for your AWS account and

Note: You can determine your IP add by typing ip addr show wlan0 from the command line.


5. Change the Button’s GPIO Number

412

Open setup_gpio.sh with Nano and replace the number 409 with 412. When Sam wrote this project, he chose to use C.H.I.P.’s 409, but the version we built uses 412.
nano ~/AlexaCHIP/setup_gpio.sh

main412

You also need to edit main.py and change filename = ‘/sys/class/gpio/gpio409/value’ to read filename = ‘/sys/class/gpio/gpio412/value’.
nano ~/AlexaCHIP/main.py

Once you’ve made the edit, save and quit Nano.


6. ALSA Sound Configuration

alsa

Use Nano to open the ALSA configuration file at /usr/share/alsa/alsa.conf. Find the line that says, pcm.front cards.pcm.front and change it to read pcm.front cards.pcm.default. Save your work, exit Nano, and reboot your C.H.I.P..
sudo nano /usr/share/alsa/alsa.conf
sudo reboot


7. Modify main.py

Edit your main.py script based on jitto’s modifications to main.py.

-	with open('recording.wav') as inf:
+	with open('recording.wav', 'rb') as inf:

-	data = r.content.split(boundary)
+	data = r.content.split(boundary.encode('utf-8'))

-	audio = d.split('\r\n\r\n')[1].rstrip('--')
+	audio = d.split(b'\r\n\r\n')[1]

Note: It’s really easy to incorrectly edit this line! Not only do you need to remove .rstrip(‘–‘), but you also need to add the letter b to d.split(b’\r\n\r\n’)[1].

-   with open('recording.wav', 'w') as rf:
+	with open('recording.wav', 'wb') as rf:

-	audio = ""
+	audio = b""


8. Install Python3

Install Python 3 to take advantage of the code changes jitto implemented.
sudo apt install python3-pip

Use pip3, the Python package manager, to install a few required libraries.
sudo pip3 install python3-memcached pyalsaaudio

Reboot your system.
sudo reboot


9. Run setup_gpio script by typing

Run setup_gpio.sh as root to configure the button’s GPIO pin. You’ll need to run this script each time you start PringlesAlexa.
sudo setup_gpio.sh


10. Tweaking the Volume

alsa
You may need to play around with the volume output of C.H.I.P.’s mixer to obtain clear playback. There are a few ways to do this, but the easiest is to type the following amixer command in at the command prompt.
amixer set ‘Power Amplifier’ 55%

A second option — and one that’s more visual — is to run alsamixer, which is a ncurses based front-end for controlling the onboard mixer.
alsamixer

Note: Press the ESC key to quit the mixer.


11. Run the Client Software

To start the Pringles Alexa, simply run the command below.
sudo python3 main.py

After a moment you’ll hear a voice say, “Hello!” At this point, the system is ready to rock. Simply hold down the button and start your question off by saying, “Alexa” and pose your question.


Part 3: Custom Microphone and Speaker Circuit

We built a custom DIP that integrates the microphone, amp, speaker, and button into a single board that fits snugly inside a Pringles tube. You’ll find the schematic and bill of materials below. But if you’re looking for a less DIY option, you can use a USB sound card with audio in and out. You’ll still need to wire a button to GPIO 412.

Schematic

schematic

Bill of Materials

Qty Value Device Package Parts Description
1 LED5MM LED5MM LED1 LED
1 .47uF C-USC0805 C0805 C9 CAPACITOR, American symbol
1 0.1uF C-USC0805 C0805 C10 CAPACITOR, American symbol
1 100nF C-USC0805 C0805 C3 CAPACITOR, American symbol
2 1uF C-USC0805 C0805 C6, C8 CAPACITOR, American symbol
1 2K R-US_R0805 R0805 R2 RESISTOR, American symbol
1 2X20-CHIP-HEADERS2X20-PTH-CHIP 2X20-CHIP-HEADERS 2X20CHIP-TH J1 Through hole layout with chip reference
1 3300pF C-USC0805 C0805 C4 CAPACITOR, American symbol
1 4.3K R-US_R0805 R0805 R1 RESISTOR, American symbol
3 4.7uF C-USC0805 C0805 C1, C2, C5 CAPACITOR, American symbol
1 470uF C-USC0805 C0805 C7 CAPACITOR, American symbol
1 ALCO-1571294-3 ALCO-1571294-3 ALCO-1571294-3 U3
1 ELECTRET-MIC ELECTRET-MIC AOM-4454P-4 MIC1
1 PAM8403 PAM8403 PAM8403 U2
1 R100 R-US_R0805 R0805 R3 RESISTOR, American symbol
1 SPEAKER SPEAKER SPEAKER-CDS-25148-L100 U5

chipLogo64x64

Whether you’re ordering socks or checking the weather, make sure to share how you’re using Pringles Alexa. Leave a comment below, Tweet a photo, or describe your full build on the forums. We can’t wait to hear from you!

]]>
Own Your Own Cloud with C.H.I.P.! https://ntcblogbackup.wpengine.com/own-your-own-cloud-with-c-h-i-p/ https://ntcblogbackup.wpengine.com/own-your-own-cloud-with-c-h-i-p/#comments Thu, 06 Oct 2016 19:25:38 +0000 http://blog.nextthing.co/?p=1072 Not a cloud in the sky, except owncloud on C.H.I.P.

Not a cloud in the sky, except owncloud on C.H.I.P.

Take back ownership of the cloud with ownCloud, a USB thumb drive, and C.H.I.P. on your home network. It’s easy to setup on C.H.I.P. with ownCloud and you’ll be able to share files, photos, address books, and even calendars all from hardware that’s yours.

Chris Watterston’s sticker popularized a common jab at all the cloud computing hype: “There is no cloud, it’s just somebody else’s computer.” Maybe. But with ownCloud and C.H.I.P. the cloud is yours!

1. Flash C.H.I.P.

Use the online flashing tool to update your C.H.I.P. with the 4.4. Headless image. The flasher has built-in instructions, requires only a USB micro cable and paperclip, and takes only a few minutes.

Note: Flashing overwrites all the data on C.H.I.P., so backup any personal files you want to keep. For an easy backup, use a USB thumb drive or try your hand at SCP.


2. Add a Monitor & Keyboard

Connect a keyboard and monitor to C.H.I.P. for easy access to the command-line. Once you have everything setup on C.H.I.P., you can unplug the keyboard and monitor and deploy your cloud anywhere you can give it power.

Note: Alternatively, you could use a USB-to-Serial cable to connect to C.H.I.P. and forgo the monitor and keyboard. Consult the C.H.I.P. docs for more on this option.


3. Setup WiFi

From the command-line, use the nmcli utility to setup a network connection. In the command below, replace SSID_NAME and WIFI_PASSWORD with your home network information.
sudo nmcli device wifi connect 'SSID_NAME' password 'WIFI_PASSWORD' ifname wlan0

Note: Do not add a line break between ‘WIFI_PASSWORD’ and ifname.


4. Install SSH

Use apt to update the Debian package information on your system and install SSH.
sudo apt update && sudo apt install ssh

Determine C.H.I.P.’s IP address so you can remotely connect to it.
ip addr show wlan0

On your laptop, use SSH and connect to C.H.I.P.. Linux and macOS have SSH clients built-in and accessible from the terminal. Windows users need to install an SSH client such as Putty.


5. Setup Locales

locales

Locales on C.H.I.P. define the region and language the software should use. For most packages, it doesn’t matter too much if locales are fully setup, but OwnCloud and many of its required packages require a properly configured system.

Type the command below and follow the on-screen steps.
sudo apt install locales && sudo dpkg-reconfigure locales && sudo locale-gen

Use the arrow keys and tab to move around, and spacebar to mark your desired selection. Many locations have multiple entries. Select your desired region with UTF8.

Note: In BASH, && is a way to connect two (or more) commands together. The second command will run only if the first command runs successfully.


6. Setup Avahi

Avahi enables you to connect to C.H.I.P. using the machine’s hostname, not just it’s IP address. It’s preinstalled on the 4.4 Headless image, so you just need to tweak a few configs. Create the file /etc/avahi/services/afpd.service using the text editor Nano.
sudo nano /etc/avahi/services/afpd.service

Note: For help with Nano, check out this great guide.
Populate the file with the following text, save it, and quit.

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
</service-group>

Open /etc/hostname with Nano and change chip to whatever new hostname you want to use.
sudo nano /etc/hostname

Open /etc/hosts and swap out chip with the same hostname you used in the /etc/hostname file.
sudo nano /etc/hosts

Restart the Avahi daemon so your new hostname takes effect.
sudo /etc/init.d/avahi-daemon restart


7. Install ownCloud

Use apt to install ownCloud and the MySQL database server.
sudo apt install owncloud mysql-server

When prompted to create a password for the MySQL root user, pick a password that’s different than your Debian root password –it’s never wise to reuse passwords.


8. Configure MySQL to work with ownCloud

Now that your C.H.I.P. has a running MySQL database server, you’ll need to create a database for ownCloud to use and set permissions for accessing the data. You’ll only need to deal with the MySQL command line once.

Access the MySQL command line as the MySQL root user and use the -p argument to force login with a password. Remember, the MySQL root password should be different than the Debian root password.
mysql -u root -p

A MySQL server can host multiple databases on the same system. Create a new database called owncloud specifically for use with ownCloud.
CREATE DATABASE owncloud;

Note: It’s a common practice to capitalize SQL keywords and, for me, it makes the commands easier to read.

Create a MySQL user named owncloud that has permission to access the database owncloud to write and request data. Replace YOUR_DB_PASSWORD with a custom password for the owncloud user.
CREATE USER owncloud@localhost IDENTIFIED BY 'YOUR_DB_PASSWORD';

Set the level of permission the owncloud user should have in the database.
GRANT ALL PRIVILEGES ON owncloud.* TO owncloud@localhost;

Reload the part of the database that keeps track of permissions so that all the changes you just made take effect.
flush privileges;

Quit the MySQL command line.
quit


9. Configure a USB Thumb Drive for ownCloud

Create a directory where all of your ownCloud data should live. You can specify a directory on C.H.I.P.’s built-in storage or you can specify USB thumb drive.
sudo mkdir /media/owncloud

Determine the UUID of the USB drive and write it down.
sudo blkid

Open /etc/fstab and type in the text below. Replace YOUR_UUID_HERE with the output from the command above.
sudo nano /etc/fstab

UUID=YOUR_UUID_HERE /media/owncloud vfat auto,users,uid=33,gid=33,dmask=027,fmask=137,utf8 0 0

NOTE: The text above should be entered on one line.


10. Browse to Your Cloud

1stlogin

On your laptop open a web browser and surf over to your C.H.I.P. at HOSTNAME.local/owncloud. Replace HOSTNAME with what you called your C.H.I.P. in Step 3. Then simply fill out all the input fields and your setup is done.

  • Username: pick whatever you want
  • Password: pick whatever you want
  • Data folder: /media/owncloud/
  • Username: owncloud
  • Password: YOUR_DB_PASSWORD from Step 4
  • Database: owncloud
  • Host: localhost

11. File Browse

Own your own cloud with C.H.I.P. and ownCloud

Own your own cloud with C.H.I.P. and ownCloud

Now that your cloud is running on C.H.I.P., you’ll be able to access it while connected to the same home network. Easily transfer files from your phone to your laptop using ownCloud’s browser-based graphical interface.


BONUS STEP: Install an ownCloud Client on PocketC.H.I.P.

clientowncloud

To make ownCloud really useful you’ll want to setup a few of your devices with the dedicated client application. Installation is really straightforward, just follow the install instructions on the ownCloud site. All of the clients except the iOS and Android apps are completely free, but don’t worry, you can use the Linux client on PocketC.H.I.P. free of charge. ᕕ( ՞ ᗜ ՞ )ᕗ


chipLogo64x64

We want to see what you’re working on! Don’t wait until your project is finished to share it!

Pose with your project, take a quick snap, or describe it in writing, we love it all. You can find us on Twitter, reach us on Facebook, or, best of all, join the lively conversation in the forum.

]]>
https://ntcblogbackup.wpengine.com/own-your-own-cloud-with-c-h-i-p/feed/ 18
NTC Project: Blast Off with RocketC.H.I.P.! https://ntcblogbackup.wpengine.com/blast-off-with-rocketc-h-i-p/ Tue, 15 Mar 2016 13:00:27 +0000 http://ntcblogbackup.wpengine.com/?p=74

This is RocketC.H.I.P.: a C.H.I.P. with specially configured WiFi and the circuitry to control a relay. Take any WiFi device like PocketC.H.I.P., connect to the RocketC.H.I.P. network, and wirelessly blast those rockets off!

I built RocketC.H.I.P. to highlight a few interesting features of C.H.I.P..

First is access point mode, a wireless configuration that allows C.H.I.P. to act like a WiFi router. This is handy for using C.H.I.P. with other devices when out in the field.

The second is utilizing RelayDIP, a custom accessory board for C.H.I.P. made by my coworker Gus. Controlling relays is really handy when working with different power requirements. They allow a small amount of current to control a larger amount, which makes them perfect for use with low power computers like C.H.I.P..

Field_Launch_RocketCHIP

Ready for the moon! Photography by Michael Bucuzzo

For more great C.H.I.P. projects to make or to submit your own build, check out our Hackster.io page.

Note: In the video you’ll see there are some wires involved in this process, that’s because we take safety seriously! In order to wirelessly launch, a wired pin and button must be depressed or the wireless launch command will fail.

TIME: 2-4 hours
COST: $40-70


Parts:

Note: You’ll be modifying the igniter, so you may want to purchase an inexpensive starter kit that includes a rocket, launchpad, and launcher. All the rocket kits I found did not include engines, so expect to buy those separately.


Tools:
You may need additional tools depending on the type of rocket kit select, but here are the basic ones you’ll need.

    • Computer
    • (Optional) Monitor, keyboard, and mouse for C.H.I.P.
    • Soldering iron and solder
    • Wood glue and epoxy
    • Wire cutters


Software Installation & Configuration

You’ll need an internet connection to install the software, so these steps are best done away from the launch field.

If this is your first C.H.I.P. project, make sure to have a monitor, keyboard, and mouse to make it easier to setup your system. Once you have WiFi working, consider ditching the extra accessories and work with C.H.I.P. wirelessly.

screen_wifisettings

1. Connect to C.H.I.P.

There are several ways to interface with the C.H.I.P. command line in headless mode: setups that don’t require a monitor and keyboard. Some require additional hardware like a serial cable, others require that WiFi is setup.

I use SSH (Secure SHell). It’s already setup on C.H.I.P. and all you need to do is determine the IP address of your $9 computer. We’ve documented all the various headless C.H.I.P. options in our docs pages. Once you figure out how you want to connect to C.H.I.P., jump back to the project.

One big reason to consider using SSH is that you’ll have a command line on C.H.I.P. on the same computer your using to read these instructions. That means copy and pasting the commands is a breeze.


2. Update C.H.I.P.
update_RocketCHIP

At the command prompt type the code below and then hit enter.
sudo apt-get update
This updates the information available to the package manager running on C.H.I.P.. It’s important to run this to keep your system aware of new software versions and the libraries necessary for them to run properly.


3. Upgrade C.H.I.P.

Next, upgrade the system.
sudo apt-get upgrade
This command makes sure that all the latest versions gleaned from the update are installed.

Note: To learn more about apt-get and how to install packages on Linux, check out the Debian package management tool here.


4. Install DNSmasq
APTDNSMASQ_RocketCHIP
Use apt-get to install dnsmasq.
sudo apt-get install dnsmasq

DNSmasq is a software package that enables you to setup a small dynamic host protocol (DHCP) network using C.H.I.P..

Note: DNSmasq is cryptic, so it’s always good to brush up with some good documentation. Or you can just copy the config that works for RocketC.H.I.P. in the next step.


5. Configure DNSmasq
DNSmasq_config_RocketCHIP
It’s not enough to simply install dnsmasq, use the text editor nano to write a configuration file.
sudo nano /etc/dnsmasq.d/access_point.conf

Enter the text below into the access_point.conf file for the proper RocketC.H.I.P. configuration.

interface=wlan1
except-interface=wlan0
dhcp-range=172.20.0.100,172.20.0.250,1h

Note: If you feel lost with nano, check out this great tutorial.


6. Static IP Setup

networkinterface_RocketCHIP

Set a static IP address for the access point on wlan1, since the IP address won’t change it will make it easier to find your RocketC.H.I.P. server.

sudo nano /etc/network/interfaces

Populate with the file with following configuration:

source-directory /etc/network/interfaces.d
auto wan1
iface wlan1 inet static
address 172.20.0.1
netmask 255.255.255.0

Note: Static addresses get their name because they don’t change when you reboot. This is opposed to dynamic IP address, which can potentially change on reboot and are typically served by DHCP servers.


7. Double-check IP Configuration
5

Run these commands to double-check the network configuration of C.H.I.P..

sudo ifup wlan1
The ifup uses /etc/network/interfaces, loads the network interfaces in the configuration file, and enables it.

sudo ifconfig wlan1
This command will output the IP address attached to the wlan1 interface. Compare the output of this command to the image above.


8. Restart the DHCP server
dnsmasq_restart_RocketCHIP

sudo /etc/init.d/dnsmasq restart

Note: As mentioned briefly above, DHCP severs assign a dynamic IP address to a client device. In this project, C.H.I.P. will provide any client device requesting an IP address with one between 172.20.0.1 and 172.20.0.254.

DHCP servers also can configure client details like the route for traffic to get to the internet and which domain name servers to use. That stuff is way beyond the scope of configuration you’ll need for RocketC.H.I.P.. Here you’ll just need PocketC.H.I.P. and C.H.I.P. to communicate, not browse the internet.


9. Configure the Access Point on C.H.I.P..
hostapdconfig_RocketCHIP

Edit the hostapd.conf file by typing:
sudo nano/etc/hostapd.conf
Populate the file with:

interface=wlan1
ssid=CHIP_AP
channel=1
ctrl_interface=/var/run/hostapd

Then start hostapd.
sudo hostapd /etc/hostapd.conf

C.H.I.P. will now broadcast an SSID called CHIP_AP. You can test the functionality by using any WiFi enabled device and connecting to the network name CHIP_AP.

Note: There’s no need to authenticate to join the network, though you can enable a password requirement in the configuration file. Check out this bbs post for more info.


10. Write a Systemd HostAPD Configuration

Since you’ll want your access point to work even after a system reboot, edit one more config file.

sudo nano /lib/systemd/system/hostapd-systemd.service

Fill the file with the following text.

[Unit]
Description=hostapd service
Wants=network-manager.service
After=network-manager.service
Wants=module-init-tools.service
After=module-init-tools.service
ConditionPathExists=/etc/hostapd.conf</code>

[Service]
ExecStart=/usr/sbin/hostapd /etc/hostapd.conf

[Install]
WantedBy=multi-user.target

And finally run these commands.
sudo update-rc.d hostapd disable
sudo systemctl daemon-reload
sudo systemctl enable hostapd-systemd
sudo systemctl start hostapd-systemd
systemctl status hostapd-systemd

11. Install Git
Apt-get_git_RocketCHIP
Use apt-get to install git.
sudo apt-get install git

Git is a popular version control system used by many open source software projects.


12. Install Node.js
Head over to nodejs.org and follow the Debian and Ubuntu installation instructions.

This project uses Node.js to control GPIO, interface with Relay DIP, and provide a web-based user interface to launch the rocket.


13. RocketC.H.I.P. Software Setup
Follow the RocketC.H.I.P. software installation instructions on the repository page. Once you’ve installed everything with npm, use git to clone the RocketC.H.I.P. software repository.
git clone git@github.com:NextThingCo/rocketchip.git

Note: Git can get confusing, but there are docs that help you gain familiarity. You don’t need to be a git pro to setup RocketC.H.I.P..


13. Run the RocketCHIP Server

On C.H.I.P. change to root by typing the following code.
su -

Start the RocketC.H.I.P. server.

cd /home/chip/rocketchip/
npm start

On a different device, connect to the CHIP_AP WiFi network, launch a web-browser, and point it to 172.20.0.1:3000. Once the server is running, you should see a user-interface like the image below.

RocketUI_RocketCHIP

Note: If you’re having trouble connecting to the 172.20.0.1, make sure the device you are connecting with is on the CHIP_AP WiFi network.


The Physical Build

Relay_DIP

The Relay DIP is able to take a small input current and control a larger output current. This is great when dealing with low power computers like C.H.I.P. And since a relay is basically a switch, consider using the Relay DIP to control a garage door, home lighting, or any other application where a switch is used.

Parts

  • Prototyping board
  • Resistors: 100Ω (x2) and a 1kΩ
  • LED
  • 1N4004 diode
  • 5V relay
  • 2N4403 transistor
  • Male header pins, .1″ pitch
  • Screw block terminal

1. Build Relay DIP
RelayDIP

Solder Relay DIP according to the schematic above. Duplicating Gus’ exact layout of the DIP is not necessary, just make sure it matches the schematic.

Note: If you’re new to reading and building from schematics, check out this helpful guide.


2. C.H.I.P. + Relay DIP = RocketC.H.I.P.

CHIP+DIP=RocketCHIP

The Relay DIP sits atop C.H.I.P. and is controlled by pin XI0–P1 on the U14 rail. To install the DIP, simply line the male header pins of the DIP up with the exterior female rails.

Note: Check out the docs site for a handy GPIO primer.


3. Splice the Ignition Wire

FullSizeRender

Separate the the plastic insulation between the two wires of the ignition system. Then cut only one of the wires and strip its ends. The wire should look like the image above after you’ve completed this step.


4. Wire the DIP

ScrewBlock_RocketCHIP

Insert both wires into separate screw block terminals. It doesn’t matter which wire goes in which terminal, just that there is only one wire per terminal. Tighten down the terminals with a screwdriver.


Get Ready and Launch!

NTC_Doge_Space

Assuming your rocket is ready, grab all your stuff and head to the launch field.

    1. Power C.H.I.P. using a LiPo battery.
    2. Connect to CHIP_AP using PocketC.H.I.P or any WiFi device.
    3. Prep the rocket and connect the ignition clips to the motor.
    4. Clear the area, insert the safety key and depress the ignition button.
    5. Count down! Then press Launch on the RocketC.H.I.P. interface.

Going forward

Launching model rockets is only one use for wireless AP mode. Use C.H.I.P. in AP mode to expand your wireless network outdoors. Since it’s easy to power C.H.I.P. from a battery, extending network range is as simple as placing C.H.I.P. where you want better connectivity. Let us know how you plan to use AP mode or the relay DIP over on the BBS.

]]>
NTC Project: Upcycle Your Old Speakers with C.H.I.P. https://ntcblogbackup.wpengine.com/ntc-project-upcycle-your-old-speakers-with-c-h-i-p/ https://ntcblogbackup.wpengine.com/ntc-project-upcycle-your-old-speakers-with-c-h-i-p/#comments Tue, 01 Mar 2016 16:00:47 +0000 http://blog.nextthing.co/?p=128 infull

Upcycled speakers with C.H.I.P., a new amp, hard drive, and LiPo battery

I recently acquired a really handsome pair of speakers. The cabinets are made of a gorgeous solid walnut exterior, and have an ideal size that Goldilocks could only dream. You simply don’t find speakers that look this good anymore: veneer, plastics, and MDF rule the day when it comes to speaker materials.

header_handsome

There was one essential problem: they just didn’t sound very good. Equipped with 40+ year-old drivers, they lacked good definition and decent high end. As a remedy, I paid a visit to parts-express and used some of their great tools to find speakers that would fit the existing cutouts (more or less), be appropriate for the size of sealed cabinet, and find a crossover that would match the drivers.

(The crossover provides filtering for the drivers so they only reproduce sound that is appropriate for each speaker. There’s not much point in feeding the woofer high-frequency sound, and vice-versa for the tweeter.)

wood

Solid walnut speakers ╭( ・ㅂ・)و

The other problem with these speakers is that I already have plenty of speakers. Too many, really. I needed a good reason to dig in and rebuild these beauties.

Enter C.H.I.P. and the software package music player daemon (mpd). Paired with a small amplifier to power the speakers and a spare 500GB hard drive, C.H.I.P. and mpd serve as the brains of the operation to manage files and playback music. After a few hours of work, I ended up with a great-looking, self-contained music system that can play a huge collection of songs. Here’s what I did.

Materials!

The list below has some flexibility in it, of course. I have a LiPo battery for C.H.I.P. so I didn’t need the powered hub. You can also avoid using a hub if you use a USB thumb drive or some other storage that requires less power than a spinning disc.

  • C.H.I.P. computer
  • LiPo Battery
  • Two handsome stereo speakers
  • Low and high frequency drivers, a pair of crossovers, and a small amplifier*
  • TRRS-to-RCA cable
  • USB hard drive
  • Powered USB hub (if hard drive enclosure does not have a power supply)
  • USB cables
  • WiFi Connection
  • Speaker Wire
  • Gloves and a mask are recommended for this project

*If you must know, here’s what I bought:

  • Speaker Crossover 2-Way 8 Ohm 5,000 Hz 150W Part # 260-198
  • Tymphany TC9FD18-08 3-1/2″ Full Range Paper Cone Woofer Part # 264-1062
  • GRS 8FR-8 Full-Range 8″ Speaker Pioneer Type B20FU20-51FW Part # 292-430<
  • Lepai LP-269FS 4x45W Mini Amplifier with Remote USB MP3 Media Card FM Part # 310-304

Rebuild

working

First, I had to remove all the old components and install the new ones. This didn’t require much more than a bit of work with a driver and a drill. I had to be careful with the baffling – old fiberglass will make your skin itch quickly, and the dust is pretty nasty!

safety

And that’s why we have the “SAFETY!” drawer in the NTC shop.

Once the new drivers were in, wired up, and tested to work, I sealed up the cabinet, and even grabbed a nearby caulking gun to keep everything tight around the edges. The only air I want moving is what the drivers push around!


Sound

backback_connections

Testing the placement of components on the rear of the speaker

The Lepai amplifier is really quite cool. This model can drive up to 4 speakers, and is designed for people wanting to beef up systems in boats, cars, RVs, and motorcycles. It’s small, and has mounting wings to lock it down with screws. It also has an FM tuner and can read music from USB sticks and SD cards. This makes it easy to test the amp and speakers to make sure everything is working correctly.


C.H.I.P.

I suppose many people would stop there: pop in a USB stick full of music and press play!

But my music collection is larger than the biggest SD and USB storage devices, and I wanted the ability to create playlists and control this thing from anywhere in WiFi range. C.H.I.P. to the rescue!

Not only was this incredibly easy to get running, it works great. I even went the extra step of re-flashing C.H.I.P. with a version of Debian with no desktop manager or windowing environment. Since all this C.H.I.P. does is play music and serve up an interface on the web, I don’t need a GUI to get around.

1. (Optional) Keep C.H.I.P. Simple

How? Simply flash C.H.I.P. with a Debian, no GUI image. Just follow the instructions in our docs using Option 2: Flash with Debian.

Simple” here, of course relates to what C.H.I.P. has to do, not you. This step actually makes things slightly more complicated for you! However, most of the work for this is going to use the terminal, so it’s really a very slight difference.


2. Get On-board

If you skipped step one, you can hook up C.H.I.P. to a network like you would any other computer.

If you did step one, you’ll need to get on a network using the command-line network tool nmcli. You can connect C.H.I.P. to a computer’s USB port, and setup the network using a serial terminal, or you can hook up a monitor and keyboard to type commands on C.H.I.P.

Once you have a command line prompt, here the short version of how to connect with nmcli is:
sudo nmcli d wifi connect networkname password wifipassword ifname wlan0

You’re smart, so it’s probably obvious that you should put in your wifi network name for networkname and your password for wifipassword. But, for posterity’s sake, I’ll mention that. Just in case 🙂

Note: If you need more info about nmcli, check our documentation.


3. Make C.H.I.P. Do Music Things

mpd

For that, you’ll install the program mpd. It’s as simple as the name (which stands for “music player daemon.”).

To install mpd, in the terminal, enter the line below to update your package installer then install mpd:
sudo apt-get update && sudo apt-get install mpd

By default, mpd will look for music files in /var/lib/mpd. If you don’t want to add a drive to C.H.I.P., you can just add music to that directory and start playing with an mpd client (more on that later).

Note: You can learn a lot about mpd on the internet.

In short, the way mpd works is that it uses C.H.I.P. to play and organize music, but if you want to control it at all (like press play), you’ll need a client software of some sort.

What’s cool is that clients can run on C.H.I.P., your phone, tablet, or another computer, giving you instant access.


battery_no

C.H.I.P. wired to my hard drive and powered USB hub

4. Add A Storage Unit.

I used a small hard drive leftover from various laptop upgrades. It’s 500GB, housed in an inexpensive USB case, and perfect for holding my music. C.H.I.P. needs a bit more power for the drive to operate, which can be achieved either by adding a battery to C.H.I.P. or a powered USB hub.

I like the battery option because it provides a power backup in case of outage and reduces the wire count.

battery_with

Cable management is easy, at least for this project

Once the drive is hooked up, C.H.I.P. needs to be told where the drive is and how to deal with it. Back to the terminal!

While our documentation covers this topic, it’s worth condensing into this post:

Connect the drive to C.H.I.P.’s USB and use the command below to list all the attached devices.
ls /dev/sd*
You’ll most likely see.
/dev/sda1
This is the name of your drive, as far as the operating system is concerned.

Now that you know the drive name, create a directory that will serve as a mounting point for /dev/sda1.
sudo mkdir /drives

Give mpd permission to access file in the directory you just created.
sudo chmod -R 777 /drives

Next, mount the /dev/sda1 with the mounting point /drives.
sudo mount /dev/sda1 /drives

Finally, you’ll want this drive to mount when C.H.I.P. boots up. Edit the /etc/fstab and enter the information to properly mount /dev/sda1.

Note: Fstab is short for the file system table.
sudo nano /etc/fstab

Add the line below to the /etc/fstab.
/dev/sda1 /drives vfat defaults 0 0

Save your change and at the command line, make sure all is good with fstab by running sudo mount -a. If no errors are produced, your setup is good to go.


5. Make It Work

Now it’s time to configure mpd. First, create a playlist directory on the hard drive.
mkdir /media/Music/playlists

Open up the mpd configuration file in a text editor.
sudo nano /etc/mpd.conf

Find the lines for music_directory and playlist_directory, and change them so they look like the lines below.
music_directory "/drives/music"
playlist_directory "/drives/playlists"

Note: ctl-w in nano makes it easy to find strings!

Of course, I’m assuming that you have all your music in a music folder on your /drive. Change as needed!

Now sudo reboot C.H.I.P. and move on to the next step.


6. Get Some Clients.

Not because you’re a lawyer fresh out of school, but because you need to play some music out of C.H.I.P. on some totally rad (not to mention handsome) speakers! There are a ton of clients available. I have an iPhone, and I use MPoD, which works well.
mpod_use

Note: I have been filling up my drive with music on my Mac. When I reconnected the drive to C.H.I.P. and tried to play the new music from MPoD, I had to go to the Settings and first select “Update Database” to tell C.H.I.P. to get to work, then “Refresh local cache” to get all the new listings on my phone.

At this point you should be good to go with C.H.I.P., mpd, and your upcycled speaker!


7. Going Further
But don’t stop here, what other cool things can you do now? You could add an external sound card to improve sound quality, you could setup icecast with mpd to make your own network radio, you could install Samba or AFP for network access to the files, or even just use SFTP with an FTP client and access your music files that way. Here’s a few resources that might help you out.

infull

For more C.H.I.P. specific projects, check out


]]>
https://ntcblogbackup.wpengine.com/ntc-project-upcycle-your-old-speakers-with-c-h-i-p/feed/ 6