What it means to troubleshoot

I went to a tech meetup and someone stood up and said, “does anyone want a project?”.  I have a habit of saying yes too often so naturally I said yes. I would try it.  He gave me an email address.  I fired off a message.

It was a concealed electronics magic trick.  The original proposal was Arduino, with bluetooth.  That’s cool.  I know Arduino enough to hack around.  the project wasn’t hard, I figured I could use standard libraries and hack together a code to make it happen.

Also it has to be small enough to be concealed.

Also he already had a few chips that he gave to me to use.

I was gifted one arduino, two ESP8266 and some extra peripheral logic chips to help them talk.  (~$30 of chips)

I tried to use and ESP alone.  Apparently there is a way to hack them to talk to a PC via an arduino.  So I tried that and gave up.  I bought an FTDI chip on ebay ($6 and two week’s wait).  The right chip, but I spent a solid 5 hours trying to work out why it wasn’t showing up in the software’s list to recognise boards plugged in before I took a break and a day off and talked to a friend and they offered to look.

Bearing in mind that I had changed out every wire I could think of except for the USB cable because I didn’t have one.  Two days later, I was going to go to a makerspace and ask for help when I happenstanced to visit a friend while I had the box of parts in my car.  I grabbed the box and started talking about the project.  About 5 minutes later the problem was the USB mini cable that was a charge-only cable.

I took the project home and started trying to use the FTDI chip for real this time.  I was making progress except that the FTDI wouldn’t talk to the ESP chip.  Some power lights sometimes, but nothing even close to “communication” no matter what I did.  So I took another break.

Consulted a different electronics wiz.  Who said, give up.  Don’t bother with the ESP chip, instead use a NodeMCU which is an FTDI+ESP8266 built in.  Okay.

I bought 4 nodeMCU chips so that I can have two pairs, one for now, and one pair for when I want to do another project and need chips.  ($7*4 = $28 total and one week’s post)

 

They arrived on a friday and  I didn’t realise so I opened them on Sunday.  It was then I went “hell yea!” and tried to plug them in.  earlier due to all my troubles with the ESP chip alone I was messing around with the code on the bootloaders (the instruction to program the chip from my laptop – apparently in earlier versions of things it needed to be done, and if that was my problem I was willing to try that to fix it).  I tried a few things and looked at the time.  At which point I realised I was 3 hours late to my local hardware meetup.  I was going to stay home and hack when I realised, naa – better go.  bet someone can help me.

Grabbed a box for the project and drove to the meeting.  40mins left in the meeting.

Got to the meeting and sat down on my laptop, figured I would try something.  Uninstall the previous bootloader (that I edited) and reinstall it.  and BAM!

Step 1: Blink. (turn the small builtin LED on and off)  YES!

Step 2: it’s a meetup.  Not 5 minutes into playing around and someone walked past and said “Is that a nodeMCU”.  “yes it is”.  At which point he pulled out two from his bag and said, “teach me how they work”.  Ohshit.jpg

make out like I know what I am doing*.  Point at the chip, information dump everything I know, That’s an ESP8266, that’s the surrounding so you can program it.  That’s the wifi antenna.

(*not actually – in reality I told him I had barely a clue and had just got them.  But I still shared all my knowledge)

Let’s try it.  Putting down my project, we plug his foreign other-brand Node-Mcu equivalent into the micro-usb port, and send it a blink.  Sweet.  I got this.

Turns out a blank board with no sensors or peripherals can’t do more than blink.  Which is okay, blink is my JAM, blink is my skills.  I make it blink in (0.5sec on/1sec off), I swap it.  We can use this board.  (except for, anything practical yet – but at least it turns on)

Meetup swiftly ends because I was late anyway, take my project home.  Plug in and try a generic “wifiAccessPoint” example script.  IT WORKS!  first time.  Sign into the new wifi point on my phone.  go to the test-webpage.  “hello world!”. Aww yeaa!

Plug in a second Node, “wifiClientBasic” example.  to sign into the wifi.  Boards conflict.  Can’t use both at the same computer and see both comm outputs.  That’s okay.  Plug AccessPoint into a USB charger, ClientBasic into my computer.  Client basic boots up, logs into the wifi, and fails to load the test page.

What’s going on at the other end?  No idea.  Need a second computer.  Pull out my old Raspberry Pi. Let’s do this.  Clock says midnight.  Don’t care.  Try plug in Raspberry Pi.  No HDMI port.

Jump on ebay.  VGA->HDMI cable.  ($5 + 1 week’s wait)

Cable arrives.  Test on my laptop.  All G, High Def screen.

Test on Rpi.  Nope.  All of the nothing.  LMGTFY.  you can never go from HDMI->VGA on a pi.  pi doesn’t have the signal output functionality.  A laptop has backwards compatibility built in but not a Pi.

Ebay, tech stores, office stores, Find the right cheap screen.  Next day $150 later.  Beauty.  23inch widescreen.  HDMI port.   Didn’t even forget the HDMI cable + $8.  Let’s do this!

Open the box, plug it in, plug in my Rpi.  Houston we have vision.  Loading setup…  Setup done.

Enter username: …

>no keyboard

Not today!  Left my keyboard at my parent’s house.

Next day.  Swing past parent’s house, collect keyboard.  Come home.  Plug in keyboard.  Plug in PI. Plug in screen.  Loading up.

Enter username: …

Shit.  No idea.  It’s been about a year?  could be anything.  “Eliot”, “ELpi”.  nope.

Brainwave, “raspberry”.  nope.

*facepalm* “pi” (generic username)

Password: …

Shit.

“Raspberry”.

AND WE ARE IN.

Terminal ://> …

Now what?  (thank god for terminal history)  (up arrow a few times)  “startx”

>loads desktop environment.

IN!  >check programs installed -> arduino environment.  YESS winning!

Version 1.0.6.  No.  Not winning.  Obsolete version.

>Rpi has no wifi, *was once thinking cheap and bought the Rpi without an ethernet port*  (this is why I haven’t touched my Pi in years).  Shit.

Wait!  Arduino environment has a serial console!  Plug in the Node anyway!  Rpi nearly crashes (pretty much the least powerful computer you have ever seen).  Get the console open.
> logging in
> connection failed
> logging in
>connection failed
>little lights on the boards are dying like they have no power (they probably don’t)
>switch from a generic usb charger to a name-brand.  Marginally better.

Hrm.  not working. Rpi nearly crashed. might just download the latest environment.
>no wifi

fuckity fuck.
>remembers I bought a wifi usb this one time!
>remembers I couldn’t make it work last time
>start googling

Found lsusb – list devices

>Ralink MT7610
> raspberryPi forums: “I couldn’t make it work”
>”forum page 1 of 16″  it’s going to be a long night.

>”page 4 of 16″
> this driver works.  404page not found
>”page 5 of 16″ This driver if it’s still online.  404.Page Not Found
> “page 6 of 16” This bug is fixed in the latest version of Raspian.  Just Sudo update.
> No internet on Rpi.

Download a new Noobs image via laptop.  1gb, 20mins wait.
>try to work out what to do next while I wait.  30mins later still not quite sure how to do it.
instructions: format the USB.  *Brain* how do I do that.  Internet: no idea.

10mins later.  download KDE partition manager.

Terminal ://> sudo partition manager.

> reformat miniSD card.
> copy NOOBS across (5minutes wait)

>plug in MicroSD to Raspberry.
>power on.
>install raspian
>20mins wait

Raspian turn on…  Username: “pi”

>check wifi config.
>list of local SSID’s

Wifi USB is just *WORKING*  Like Devil magic or some shit.

>Go to open Arduino environment.  *not installed*
jump online.  *feels good to be online*
download the install file for Arduino
> 32bit or 64bit?  Shit.  No fucking idea.  Guess 32?

>downloads .tar zip

> Xarchiver unzip.  10mins.

> terminal ://> downloads/arduino-1.6.9/ Sudo install.sh

command not found

> sudo bash install.sh
*sigh*
>terminal ://> done!

>Run ArduinoIDE
*doesn’t open*

>fuck around with the config of a new system
>restart
>run ArduinoIDE *nothing happens*

>Terminal ://> sudo apt-get install arduino

>building dependency tree… (30mins later, Pi has no processing power)
> downloading
> installing

>Rpi crashes.  Restart.
>install again.  (30mins later – still going).


This is where I am up to.  with a Rpi installing the arduino environment so I can hack on a nodeMCU, I need to get a powered USB hub because the usb charger that powers the PI that powers the Node is not a great trickle-down power supply.  BUT at least I am more prepared and set up for the next project.

Update: sudo apt-get arduino installed version 1.0.5
googled the error I am getting, turns out the 32bit guess was wrong.
>downloading 64bit…


I have given up so many times.  I have started again so many times.  I have hit so many dead-walls of you can’t do anything until this one is fixed.

The summary list:

  • the specifics of getting the bits working on the arduino (not even mentioned here)
  • ESP didn’t work
  • FTDI didn’t work
  • FTDI did work but didn’t talk to ESP
  • NodeMCU didn’t connect to the other node
  • Rpi – no screen
  • Rpi – no keyboard
  • Rpi – no password
  • Rpi – wrong software version
  • Rpi – no arduino environment

And these are just the ones I can remember.  The ones that I had to work out how to solve in the process of doing this project.  Not the ones I worked out how to solve (or troubleshoot) on the last project.


this took 2 hours to write while waiting for progress on compiling code.

Liked it? Take a second to support E on Patreon!
This entry was posted in Uncategorized and tagged , , , , , . Bookmark the permalink.

Leave a Reply