Friday, July 7, 2017

Sprinkler control via BBB

Added Opto 22 relay with external 24AC source to control solenoid to backyard drip irrigation.

#!/bin/bash         

echo high > /sys/class/gpio/gpio67/direction
logger SPRINKLER ON

Friday, March 3, 2017

New Wifi Dongle for my Raspberry Pi

Mar  4 02:52:55 raspberrypi kernel: [178298.508653] usb 1-1.5: new high-speed USB device number 31 using dwc_otg
Mar  4 02:52:55 raspberrypi kernel: [178298.650114] usb 1-1.5: New USB device found, idVendor=148f, idProduct=7601
Mar  4 02:52:55 raspberrypi kernel: [178298.650134] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Mar  4 02:52:55 raspberrypi kernel: [178298.650145] usb 1-1.5: Product: 802.11 n WLAN
Mar  4 02:52:55 raspberrypi kernel: [178298.650155] usb 1-1.5: Manufacturer: MediaTek
Mar  4 02:52:55 raspberrypi kernel: [178298.650165] usb 1-1.5: SerialNumber: 1.0
Mar  4 02:52:55 raspberrypi kernel: [178298.748661] usb 1-1.5: reset high-speed USB device number 31 using dwc_otg
Mar  4 02:52:55 raspberrypi kernel: [178298.881717] mt7601u 1-1.5:1.0: ASIC revision: 76010001 MAC revision: 76010500
Mar  4 02:52:55 raspberrypi kernel: [178298.883330] mt7601u 1-1.5:1.0: Firmware Version: 0.1.00 Build: 7640 Build time: 201302052146____
Mar  4 02:52:55 raspberrypi kernel: [178299.318306] mt7601u 1-1.5:1.0: Warning: unsupported EEPROM version 0d
Mar  4 02:52:55 raspberrypi kernel: [178299.318326] mt7601u 1-1.5:1.0: EEPROM ver:0d fae:00
Mar  4 02:52:56 raspberrypi kernel: [178299.490666] mt7601u 1-1.5:1.0: Error: RX urb failed:-71

Monday, January 9, 2017

1-wire USB adapter to temperature probes

Master USB to 1-wire plugged into USB port

Jan 19 21:06:54 raspbx kernel: [ 4901.658310] usb 1-1.2: new full-speed USB device number 8 using dwc_otg
Jan 19 21:06:55 raspbx kernel: [ 4901.781932] usb 1-1.2: New USB device found, idVendor=04fa, idProduct=2490
Jan 19 21:06:55 raspbx kernel: [ 4901.805889] usb 1-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
Jan 19 21:06:56 raspbx kernel: [ 4903.019838] usb 1-1.2: ds9490r_search: max_slave_count 64 reached, will continue next search.


Per this link we need to upgrade Raspberry Pi firmware first:


root@raspbx:/etc# sudo rpi-update
 *** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
 *** Performing self-update
 *** Relaunching after update
 *** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
#############################################################
This update bumps to rpi-4.1.y linux tree
Be aware there could be compatibility issues with some drivers
Discussion here:
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=113753
##############################################################
 *** Downloading specific firmware revision (this will take a few minutes)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   168    0   168    0     0    337      0 --:--:-- --:--:-- --:--:--   338
100 48.4M  100 48.4M    0     0   730k      0  0:01:07  0:01:07 --:--:--  371k
 *** Updating firmware
 *** Updating kernel modules
 *** depmod 4.1.15+
 *** depmod 4.1.15-v7+
 *** Updating VideoCore libraries
 *** Using HardFP libraries
 *** Updating SDK
 *** Running ldconfig
 *** Storing current firmware revision
 *** Deleting downloaded files
 *** Syncing changes to disk
 *** If no errors appeared, your firmware was successfully updated to 867452b746c440fdc81551030ba5b75feced70fe
 *** A reboot is needed to activate the new firmware
root@raspbx:/etc# 



  329  more owfs.conf
  330  sudo rpi-update
  332  cd modprobe.d
  336  vi ds2490
  337  ls -l
  338  aptitude show owfs
  346  apt-get install ow-shell
  351  vi owfs.conf
  353  apt-get install fuse
  354  vi fuse.conf
  355  ls /mnt
  356  sudo mkdir /mnt/1wire


Ran into this problem:

Jan 19 22:00:15 raspbx OWFS[1683]: DEFAULT: owlib.c:(208) Cannot open USB bus master
Jan 19 22:00:15 raspbx kernel: [  225.759441] usb 1-1.2: usbfs: interface 0 claimed by usbfs while 'owfs' sets config #1

Update 1/9/2017

Reinstalled raspbx, so now need resinstall owfs packages and get this error:

Creating config file /etc/owfs.conf with new version
Setting up libow-2.9-8:armhf (2.9p8-6) ...
Setting up fuse (2.9.3-15+deb8u2) ...
Creating fuse device...
/run/udev or .udevdb or .udev presence implies active udev.  Aborting MAKEDEV invocation.
chmod: cannot access ‘/dev/fuse’: No such file or directory
dpkg: error processing package fuse (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up owfs-fuse (2.9p8-6) ...
Setting up owserver (2.9p8-6) ...
Setting up owhttpd (2.9p8-6) ...
Setting up owftpd (2.9p8-6) ...
Setting up owfs (2.9p8-6) ...
Processing triggers for libc-bin (2.19-18+deb8u6) ...
Processing triggers for systemd (215-17+deb8u5) ...
Errors were encountered while processing:
 fuse

E: Sub-process /usr/bin/dpkg returned an error code (1)

Updated the firmware again, not sure where firmware is stored - installed new os.  Looks like this version is different from the version above updated last time:

root@raspbx:/var/log/apache2# rpi-update
 *** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
 *** Performing self-update
 *** Relaunching after update
 *** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
This update bumps to rpi-4.4.y linux tree
Be aware there could be compatibility issues with some drivers
Discussion here:
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=144087
##############################################################
 *** Downloading specific firmware revision (this will take a few minutes)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   168    0   168    0     0    386      0 --:--:-- --:--:-- --:--:--   390
100 51.8M  100 51.8M    0     0   711k      0  0:01:14  0:01:14 --:--:--  401k
 *** Updating firmware
 *** Updating kernel modules

 *** depmod 4.4.41+
 *** depmod 4.4.41-v7+
 *** Updating VideoCore libraries
 *** Using HardFP libraries
 *** Updating SDK
 *** Running ldconfig
 *** Storing current firmware revision
 *** Deleting downloaded files
 *** Syncing changes to disk
 *** If no errors appeared, your firmware was successfully updated to 744900dc2887bad3efe6297210ed73d03c895b06

 *** A reboot is needed to activate the new firmware


THE ABOVE SEEM TO FIX THE FUSE ERROR ABOVE:

apt-get install fuse
Reading package lists... Done
Building dependency tree       
Reading state information... Done
fuse is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 75 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up fuse (2.9.3-15+deb8u2) ...
update-initramfs: deferring update (trigger activated)

Processing triggers for initramfs-tools (0.120+deb8u2) ...

BONUS: EDIMAX USB WIFI ADAPTER NOW WORKING TOO:

Bus 001 Device 004: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]


HTTP INTERFACE WORKING AFTER STARTING OWSERVER AND OWHTTPD
 3476 pts/1    S+     0:00 owserver -u --debug
 9323 ?        Ssl    0:03 /usr/lib/owfs/owfs -c /etc/owfs.conf -C -uall -m /mnt/1wire --allow_other
13861 ?        Ss     0:00 owhttpd -s localhost:4304 -p 2121 -F








Saturday, January 7, 2017

"OK Google" and "Google Now"

Trying to get Google Now to work consistently.  I've been able to configure "dialer" to be SIP extension on Asterisk and can back calls to other extensions.   "Ok Google" is intermittently recognized after a call - sometimes it works immediately and other times it never works. Zoiper does not work even after making Zoiper the default dialer.   When giving the command "call xyz" the option to call from GSM or Zoiper is presented.