Friday, December 19, 2014

Shame on the MetaWear Community

Why assume everyone has the latest phone?

Requiring a certain version of Android when it's well known that Carriers run on their own schedules is a big no no!

What they should have done is get their stuff working on a really old, stable version of Android. But, who knows how tough that would be?

Come On, Laura. Please!

Just for this, Mbientlab should refund the Kickstarter money..

They've got 4 pages in their getting started guide and then, "plug in your board and test." WT*!!??

Nothing about download the metawear app, then scan for bluetooth devices, etc.. *ds!!

Also, when you plug the USB thing in, you don't get a peep out of Windows. Shouldn't they say something about that?

Really sucks if you're not on IOS... Go to Play Store and search for metawear or mbientlab - nothing!

Saturday, December 13, 2014

Shame On You LadyAda

1) People are desperate to get their OLED lighting up.
2) What can you do to help?
3)   display.begin(SSD1306_SWITCHCAPVCC, 0x78);  // initialize with the I2C addr 0x3D (for the 128x64)
4) Nahh!!! Provide something that will scream into the serial port if the address is wrong (no ACK).
5) Come on, this is basic debug stuff woman :)

Else, was able to get the library and examples installed without much ada from links here :


Still struggling to get a peep..

Scary one - with a 21k code size, it takes forever for the program ..

Anyhow, watching this meister (Julian Ilet), I realize I don't have the I2C pullup resistors. So, I add those, and,... not a peep :)

But, sticking with the video - eventually brings a smile to my face. All you have to do is change 0x3D to 0x3C in their code. Never mind that the actual PCB has silkscreen writing saying addres 0x7A and 0x78 and a resistor on the 0x78 side :) So cute, the Chinese and Americans combine to chop up the world.. Did I need the I2C pullup resistors? Nope :) Shame!!! Why do they leave us guessing like this? Anyhows, all's well that ends well, onto Mbientlab when it gets here.. and then, Jül :)

I2C On Arduino Duemilanove

People have moved on to newer boards, so it's hard to find the info you need.

When they say A4 and A5, what they mean is Analog Input 4, etc. These are the pins on teh same side of the Duemilanove as the adapter jack.

Apparently, Wire.begin() is good enough to get you I2C comm on these 2 pins. Good to know.

Now, how much brain surgery before we get somewhere with the Huhushop 0.96" OLED? Let's see..

Friday, December 12, 2014

Abort, Retry or Fail all over again. Thanks Mr. Simonson

How can Win 7 make life harder than Win XP?

Because it's been around less long?

I try to get Arduino up and running and I'm running into all sorts of crap. If I try installing the driver from FTDI, I get "The requested operation requires elevation." WT*!!!Q$#!@$#!@#$

Thanks Mr. Jim Simonson!

Fortunately, some guy online says you just right-click and say Run as Administrator.

Works. But, in the end, I get "Driver not digitally signed". WT@$#$!@$#!@#$

Wednesday, December 10, 2014

How to Arm a Raspberry Pi from Your Smartphone

Watch this space..

You want to turn ON motion detection after you've left the house.

Best way is for the app to have permission to connect to your WiFi and then tell the phone with the static local IP (Eg. 192.168.1.110) to launch motion (Kenneth Lavrsen)

Better idea? Do tell...

Tuesday, December 9, 2014

Arming your Raspberry Pi with Your Phone

Okay, so you want to turn on motion detection after you get to your car. Question is, how?

This is why Apple makes hundreds of billions of $ and no Linux based product ever will. You need to get it so "it just works" and simple people can use it.

Consider what I'm trying to accomplish just now - apparently, the only way is to turn your Pi into a wireless access point that your phone can connect to. Really? Yuck!

Once you've set up your Pi so you can get into it from anywhere (which is actually tricky - for a product you want to sell, you don't want to force your customer to hack the router to forward port 22 or whatever) you need to be able to send a simple command without such bs... How?

So, to compete with Dropcam is.. to say the least... difficult - at least for someone with my rudimentary software skills.. You don't want to have servers that your products need to log into - coz that increases your cost and commitment right away.. The product must be stand-alone and use the customer's Wi-Fi and internet.

So, How?
1) How do you go into this state where you know you need to look like and access point? If the phone's going to tell you that over the cellular network, why not just use the cellular network? (Because then you need to hack the router to tell it to forward port 22)
2) This is trickier than I thought - looks like there really is no way out but to have a server somewhere that your widget logs into and communicates with :( Thanks to cloud computing and the competition there, maybe this is less of a cost issue that I worry it might be..

Mbientlab Simulator

Would be cool to use such a thing in the classroom to demonstrate concepts.. Wouldn't it?

What Mbientlab Doesn't Have

Motion sensor is what the intended app space needs, but not what I need. If they had worked with vendors and done some arm-twisting to get a really tiny motion detector, that would have been super - you want to sense someone else being near..

Sunday, December 7, 2014

how can I use motion by ken lavrsen to send a text message to my phone?

That's what we're attempting to answer today..

Short answer, edit (as su) /etc/motion/motion.conf and change

# Command to be executed when an event starts. (default: none)
# An event starts at first motion detected after a period of no motion defined by gap
; on_event_start value
 

To

# Command to be executed when an event starts. (default: none)
# An event starts at first motion detected after a period of no motion defined by gap
on_event_start /home/pi/textme.py


Simple? You would just put in on_event_start echo Alert | mail -s "Subject" number@messaging.sprintpcs.com

Okay, this actually works - but, there's a blemish - as soon as you launch motion with "sudo motion", you get a text message.. Why? That's just dumb. Is it a problem with motion?

Anyhow, I think this gmail to send text to phone with Raspberry Pi might have a hole somewhere. Just a day after doing this, I get a spam SMS this morning :(

Motion Stalls Again..

Trying to jumpstart this effort again :

pi@raspberrypi ~ $ sudo motion
[0] Processing thread 0 - config file /etc/motion/motion.conf
[0] Motion 3.2.12 Started
[0] Motion going to daemon mode
[0] Exit motion, cannot create process id file (pid file) /var/run/motion/motion.pid: No such file or directory
pi@raspberrypi ~ $ sudo ps -ef | grep motion
pi        6424  6351  0 22:25 pts/0    00:00:00 grep --color=auto motion

Fortunately, was able to go to /var/run and create a motion directory using sudo mkdir. How stupid!! Ridiculous! If I'm running motion as su, why can't it fix the problem itself?

And, works!! Go with firefox to 192.168.1.11x:8085 and I can see the picture change as I turn the light on and off! A working video webserver! Now, to get the push notification on Android..

Arduino Minute Timer

This might not be the best way... you should read this good one here as well..

//http://www.instructables.com/id/Arduino-Timer-Interrupts/

#define num_mins 2
#define LED 11
int COUNT = 1;

void setup(){

  cli();//stop interrupts

  //set timer1 interrupt at 0.25 Hz
  TCCR1A = 0;// set entire TCCR1A register to 0
  TCCR1B = 0;// same for TCCR1B
  TCNT1  = 0;//initialize counter value to 0
  // set compare match register for 1hz increments
  OCR1A = 4*15624;// = (16*10^6) / (4*1*1024) - 1 (must be <65536 )
 // turn on CTC mode
  TCCR1B |= (1 << WGM12);  // from ATMEL datasheet
  // Set CS10 and CS12 bits for 1024 prescaler
  TCCR1B |= (1 << CS12) | (1 << CS10); 
  // enable timer compare interrupt
  TIMSK1 |= (1 << OCIE1A);

sei();//allow interrupts

pinMode( LED, OUTPUT );

}//end setup

ISR(TIMER1_COMPA_vect){//timer1 interrupt 0.25 Hz increment the counter
  COUNT = COUNT+1;
}

void loop(){
  int trigger = num_mins * 15;
  if( COUNT > trigger){
     digitalWrite( LED, HIGH);
  }
} // loop

Friday, December 5, 2014

Das Arbeitets Wunderbar

http://rpi.tnet.com/project/faqs/smtp

mail or mpack do the trick. mpack can send a file

> echo test | mail -s "Subject" who@where
> mpack -s "test" who@where

Hmmm, worked okay for a day.. Now, I get :


pi@raspberrypi ~ $ send-mail: Authorization failed (534 5.7.9 https://support.google.com/mail/bin/answer.py?answer=78754 ko4sm35426303pdb.31 - gsmtp)

Was gebt?


I go to the Security - Account Settings page and I find Access for Less secure Apps is already Enabled, and 2-Step ver is already disabled... So???

So, I turn ON 2-step verification and then, it (google account security website) magically tells me I can generate and app password, do so, put that in the ssmtp.conf and all is well... 

Can You Run Raspberry Pi Off Your PC's USB Port?

Depends. Safe answer : "No"

I found out the hard way when Windows said "Power surge on USB Port", then something about port on USB hub being disabled.

Happened when I ran "sudp apt-get upgrade" and the process got to upgrading "wireshark" - aha!

When I rebooted, and tried the upgrade again, Pi said "dpkg was interrupted, you must manually do 'sudo dpkg --configure -a' to fix the problem..

Seems to be turning into a nigthmare :(

pi@raspberrypi ~ $ sudo apt-get install ssmtp
Reading package lists... Done
Building dependency tree
Reading state information... Done
ssmtp is already the newest version.
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 wireshark : Depends: wireshark-common (= 1.8.2-5wheezy13) but 1.8.2-5wheezy11 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
pi@raspberrypi ~ $ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
E: Unmet dependencies. Try using -f.


Might be able to recover :

pi@raspberrypi ~ $ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
E: Unmet dependencies. Try using -f.
pi@raspberrypi ~ $ sudo apt-get upgrade -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages have been kept back:
  gir1.2-freedesktop gir1.2-glib-2.0 glib-networking glib-networking-common
  glib-networking-services gnome-accessibility-themes gnome-themes-standard
  gnome-themes-standard-data libatk1.0-0 libatk1.0-data libgail-3-0 libgcc1
  libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgfortran3 libgirepository-1.0-1
  libglib2.0-0 libglib2.0-bin libglib2.0-dev libgomp1 libgtk-3-0 libgtk-3-bin
  libgtk-3-common libjavascriptcoregtk-3.0-0 libpango1.0-0 librsvg2-2 librsvg2-common
  libsoup2.4-1 libstdc++6 libwebkitgtk-3.0-0 php5 php5-cgi php5-common zenity
  zenity-common
The following packages will be upgraded:
  wireshark wireshark-common wpagui wpasupplicant xdg-utils
5 upgraded, 0 newly installed, 0 to remove and 35 not upgraded.
1 not fully installed or removed.
Need to get 0 B/2,086 kB of archives.
After this operation, 1,024 B of additional disk space will be used.
Do you want to continue [Y/n]?
 

Thursday, December 4, 2014

Hit, and.. Miss (Raspberry Pi WiFi)

Trying to get to where I don't have to change my WiFi settings manually each time by changing /etc/network/interfaces at home or xx..

Useless (I tried putting in auto wlan1 and, when I did that, it couldn't even get on the ethernet - had to suffer the humility of connecting monitor and keyboard :( ) :

http://weworkweplay.com/play/automatically-connect-a-raspberry-pi-to-a-wifi-network/

Less useless : (at least the ethernet still worked ) :

http://www.instantsupportsite.com/self-help/raspberry-pi/raspberry-connect-multiple-wireless-networks/

pi@raspberrypi ~ $ sudo ifup wlan0
Line 1: unknown global field 'interface=DIR=/var/run/wpa_supplicant GROUP=netdev'.
Line 1: Invalid configuration line 'interface=DIR=/var/run/wpa_supplicant GROUP=netdev'.
Line 5: failed to parse ssid '”AA″'.
Line 5: failed to parse ssid '”AA″'.
Line 11: Invalid PSK '”XX"'.
Line 11: failed to parse psk '”XX"'.
Line 12: WPA-PSK accepted for key management, but no PSK configured.
Line 12: failed to parse network block.
Line 15: failed to parse ssid '”linksys″'.
Line 15: failed to parse ssid '”linksys″'.
Line 21: Invalid PSK '”CC"'.
Line 21: failed to parse psk '”CC"'.
Line 22: WPA-PSK accepted for key management, but no PSK configured.
Line 22: failed to parse network block.
Failed to read or parse configuration '/etc/wpa_supplicant/wpa_supplicant.conf'.
Failed to bring up wlan0.


Okay, apology - the first line of the .conf should be ctrl_interface=DIR=.. not interface - you know what happened there if you've every used vi :)

And then, OMG, it works!! : 

http://raspberrypi.stackexchange.com/questions/11631/wifi-setup-for-multiple-networks

When I do "sudo ifup wlan0" after making the suggested edits, I get :

pi@raspberrypi ~ $ sudo ifup wlan0
ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument

 

Would be nice to know what those mean :) But, what a feeling! To be able to type that aaa.homenet.org and login that way!! And, to show you why I believe R-Pi will one day be ubiquitous in evidence collection, here's what I got when I went to aaa.homenet.org/snapshot.jpg (a random shot from when I once went into Heat Sync Labs and plugged the camera in before deciding it was better to work on something more basic. I didn't even know it took a pic!)


Wednesday, December 3, 2014

Learns Some at Arduino Night

Arduino wasn't created by Atmel. Arduino was done open source and they happened to use Atmel. The Large Hadron Collider at CERN runs on Arduino (whatever "run" means in this context) They've put Arduino in space. Big thing for me today was Microview. Looks like I can take it, hack it and build the reminder magnet. (Geek Ammo and Cocreators, with manufacturing by Sparkfun - what a success story Sparkfun!) What does the guy who told me about Arduino in LHC estimate it'll take - about 6 months for a team. You're talking just 80k for the app alone. A lot of people think you can build an app for 2k. You should be prepared to spend at least a 100k on a product mensch sagt. This tiny thing can be 300k - come on man, really? Then what's the point of a PhD in Computational Math?

Arduino Uses Motion Detection to Toggle an LED

=====================================
/*
Assumes a Parallax PIR on pin PIR (11 here) - no pullup resistor needed
http://www.parallax.com/product/28032
 */

int led = 10;           // the pin that the LED is attached to
int PIR = 11;    // pin that PIR is connected to..

int statePIR;
int prevPIR;
boolean lamp = false;


// the setup routine runs once when you press reset:
void setup()  {
  // declare pin 9 to be an output:
  pinMode(led, OUTPUT);
  pinMode( PIR, INPUT );
  digitalWrite( led, false );
}

// the loop routine runs over and over again forever:
void loop()  {

  statePIR = digitalRead( PIR );
  if( HIGH == statePIR && LOW == prevPIR) {
    lamp = !lamp;
  }
  prevPIR = statePIR;
  digitalWrite( led, lamp );
  delay( 10);
                          
}

Monday, December 1, 2014

FAQduino : Pin 9 and Pin 13 with Fade

The same OCD that caused me to have time to devote to this means I now start relentlessly improving Arduino.

Now, there's this packaged example called Fade. Why, I mean why can't the people who put it out there have the foresight to see that smart people will wonder why they can't get pin 13 to behave like pin 9.

Any answer? Why can't you change '9' to '13' in the Fade example and get a fade result?