Cannot run sensor when arduino yun is connected to wall power

Hi,

I've got a sparkfun 345xl accelerometer connected over 3.3v i2c to an arduino yun.

Everything works fine when the yun is powered by my laptop USB port. The accelerometer triggers, the arduino connects to my iPhone hotspot, and sends an SMS using temboo and twillo.

However this won't work when the yun is connected to a wall outlet USB power source. I've tried an iPad charger, and a 5v 1000ma android micro USB charger. The yun comes on, connects to the wifi hotspot, and I can log into the linino console just fine. However the accelerometer is never triggered.

I'm attaching a picture of the circuit. It's quite simple, and not power consuming, so don't understand why it won't work when connected to a wall source.

Here’s the picture…

Ok solved this one. I spent an hour making sure there wasn't anything unusual with the current draw, etc. Everything checked out fine electrically.

I then tried to use the serial monitor to see what was going on, when the arduino wasn't connected to the laptop with USB. That gave me a clue, that serial wasn't functioning. Turns out you need a USB connection before serial will function, and this means code won't ever move from while(!Serial); if this is specified.

I then found this link that helped me get things working again: https://temboo.com/arduino/yun/serial-to-console.

N.