Mittwoch, 3. Juni 2015

session 7: mehrzahl von strahl?

Temperatursensor:
http://www.rpiblog.com/2012/11/interfacing-temperature-and-humidity.html
http://www.uugear.com/portfolio/dht11-humidity-temperature-sensor-module/

klaghaft gescheitert.
https://www.raspberrypi.org/forums/viewtopic.php?f=81&t=91896
http://stackoverflow.com/questions/28486159/read-temperature-from-dht11-using-pi4j

geht nicht mit pi4j



ultrasonic abstandsmesser funktioniert in java.





nächstes meeting:
433mhz sender + funksteckdosen stefan (kompatibel?) schalten
kommandos der fernbedienung empfangen




interessante projekte bzw. neuausrichtung?
- mediacenter pi mit touch screen?  (http://www.mkcastor.com/2014/01/02/pipad-build/)
- ambilight pi
- chinchillapicam (http://www.tecchannel.de/pc_mobile/peripherie/2059766/mit_dem_raspberry_pi_ein_raumueberwachungssystem_aufbauen/)
- internetradio 1 station oder mehr
- rocket launcher (https://www.youtube.com/watch?v=1EGk2rvZe8A)
- wetterstation lokal (http://www.wired.co.uk/news/archive/2013-07/10/airpi http://www.weather.dragontail.co.uk/index.php?page=station_setup)
- funksteckdosen (http://www.forum-raspberrypi.de/Thread-433mhz-signale-empfangen-und-senden-mit-pi4j http://www.tecchannel.de/pc_mobile/peripherie/2064837/funksteckdosen_mit_dem_raspberry_pi_einrichten/)
- space station (http://www.daveakerman.com/?p=592)
- google calendar wall mounted (http://www.instructables.com/id/Raspberry-Pi-Wall-Mounted-Google-Calendar/)


Mittwoch, 20. Mai 2015

Session 6: Ich hol mal den Kohlrabi raus

Gadget-Time. vieles ist schon angekommen:
- 433Mhz RF transmitter and receiver kit Module for Raspberry Arduino ARM MCU
- Ultrasonic Module HC-SR04 Distance Measuring Transducer Sensor for Arduino
- HX1838 NEC Code Infrared Remote Control module DIY Kit
- New DHT11 Temperature and Relative Humidity Sensor Module for arduino
- Passive Buzzer Module 5V Buzzer Control Panel for Arduino AVR PIC Mega Raspberry
- RGB SMD LED Module 3 Color Light 5050 Pwm 4pin For Arduino MCU Raspberry pi ARM


Noch unterwegs:
- GY-273 HMC5883L Drei-Achse Kompass Magnetometer Sensor Modul
- LM393 Diode Licht Sensor Module 3.3-5V Eingang Detektion Helligkeit Neu
- New HC-SR501 Infrared PIR Motion Sensor Module for Arduino Raspberry pi HCSR501





RGB China LED zum leuchten bringen:

Digital 3 gpio ausgänge an LED schliessen und spielen:

                // create gpio controller
        final GpioController gpio = GpioFactory.getInstance();
     
        // provision gpio pin #01 as an output pin and turn on
        final GpioPinDigitalOutput gpio1 = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_01, "Rot_Pin6_rechts", PinState.LOW);
        final GpioPinDigitalOutput gpio2 = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_02, "Blau_Pin7_Links", PinState.HIGH);
        final GpioPinDigitalOutput gpio3 = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_03, "Gruen_Pin8_Links", PinState.HIGH);
     
        gpio1.setShutdownOptions(Boolean.TRUE, PinState.HIGH);
        gpio2.setShutdownOptions(Boolean.TRUE, PinState.LOW);
        gpio3.setShutdownOptions(Boolean.TRUE, PinState.LOW);
         
        System.out.println("gpio1 :" + gpio1.getPin() + ", name: " + gpio1.getName() + ", mode: " + gpio1.getPin());
        System.out.println("gpio2 :" + gpio2.getPin() + ", name: " + gpio2.getName() + ", mode: " + gpio2.getMode());
        System.out.println("gpio3 :" + gpio3.getPin() + ", name: " + gpio3.getName() + ", mode: " + gpio3.getMode());
     
          for (;;) {
              Thread.sleep(1000);
          }

---------------------

Interessant für spätere sessions:
http://aruljohn.com/blog/raspberrypi-christmas-lights-rgb-led/


Das gleiche nochmal in Analog:

    public static void testPWM() {
try {
// initialize wiringPi library
com.pi4j.wiringpi.Gpio.wiringPiSetup();

// create soft-pwm pins (min=0 ; max=100)
SoftPwm.softPwmCreate(1, 0, 100);
                        SoftPwm.softPwmCreate(2, 0, 100);
                        SoftPwm.softPwmCreate(3, 0, 100);
                     
// continuous loop
while (true) {
                         
                            for (int y=1;y<4;y++){
                                System.out.println("   0% start, pin " + y);
                         
// fade LED to fully ON
for (int i = 0; i <= 100; i++) {
SoftPwm.softPwmWrite(y, i);
Thread.sleep(100);
}

                                System.out.println(" 100% erreicht");
                             
// fade LED to fully OFF
for (int i = 100; i >= 0; i--) {
SoftPwm.softPwmWrite(y, i);
Thread.sleep(100);
}
                             
                                System.out.println("   0% erreicht");
                            }
}
} catch (Exception e) {
                    System.out.println("Exception: " + e.getMessage());
}
}








System Infos:
http://pi4j.com/example/system-info.html


http://raspberrypi.stackexchange.com/questions/14831/pi4j-changing-gpios-from-and-to-input-low-and-high

https://www.google.de/search?q=provisionDigitalMultipurposePin+PWM&oq=provisionDigitalMultipurposePin+PWM&aqs=chrome..69i57.3616j0j7&sourceid=chrome&es_sm=93&ie=UTF-8


Super seite SoftPWM + MultipurposePin:
https://github.com/MyRobotLab/myrobotlab/blob/master/src/org/myrobotlab/service/RasPi.java




Aktiver Buzzer anleitung:
http://developer-blog.net/hardware/raspberrypi/raspberry-pi-aktiver-buzzer/

Versuch den Buzzer anzusprechen - ohne Erfolg:
     public static void testBuzzer() throws InterruptedException {
     
            // create gpio controller
        final GpioController gpio = GpioFactory.getInstance();
     
       GpioPinDigitalOutput gpio4 = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_04, "Pin8_rechts", PinState.HIGH);
       gpio4.setShutdownOptions(Boolean.TRUE, PinState.LOW);
     
          for (int i=0;i<10;i++) {
              System.out.println("start " + i);
              gpio4.high();
              Thread.sleep(1000);
              gpio4.setState(PinState.HIGH);
              Thread.sleep(1000);
              System.out.println("ende " + i);
          }
       
       
       
try {
// initialize wiringPi library
com.pi4j.wiringpi.Gpio.wiringPiSetup();

// create soft-pwm pins (min=0 ; max=100)
SoftPwm.softPwmCreate(4, 0, 100);
                     
// continuous loop
while (true) {
                            System.out.println("start");
                            SoftPwm.softPwmWrite(4, 100);  //buzzer
                            Thread.sleep(5000);
                            System.out.println("done");
}
} catch (Exception e) {
                    System.out.println("Exception: " + e.getMessage());
}
     }










Donnerstag, 23. April 2015

session 4: nach kaputt ist vor kaputt

Wie kann man komfortabel in Java mit IDE unter Windows entwickeln und automatisch auf RASPI deployen?

https://blog.idrsolutions.com/2014/08/using-netbeans-remotely-deploy-projects-raspberry-pi/

netbeans installieren

java directory: /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre

auf dem raspberry:
'/usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/jre/bin/java'  -Dfile.encoding=UTF-8   -jar /home/pi/NetBeansProjects//RaspyProjekt/dist/RaspyProjekt.jar 


Ergebnis der examples:wiringPiSetup: Must be root.


lösung unter platform konfiguration:
exec prefix: sudo
wichtig, ohne leerzeichen o.ä. eingeben!


Wie muss man den Schalter (Push Button) verkabeln?
"breadboard pushbutton pi4j ":
https://apotheosis9.wordpress.com/





projekt blink erfolg:

                // create gpio controller
        final GpioController gpio = GpioFactory.getInstance();
        
        // provision gpio pin #01 as an output pin and turn on
        final GpioPinDigitalOutput gelb = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_01, "MyLED", PinState.LOW);
        final GpioPinDigitalOutput rot = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_03, "MyLED", PinState.HIGH);
        // super dirty
                for (;;) {
                    gelb.toggle();
                    rot.toggle();
            Thread.sleep(500);
        }

        





Weitere offene Tabs nach der Session:


https://apotheosis9.files.wordpress.com/2014/05/img_0540.jpg
https://apotheosis9.files.wordpress.com/2014/05/img_0542.jpg

https://www.google.de/search?q=breadboard+pushbutton+pi4j+listener&oq=breadboard+pushbutton+pi4j+listener+&aqs=chrome..69i57.11685j0j7&sourceid=chrome&es_sm=93&ie=UTF-8

http://pi4j.com/example/listener.html

http://pi4j.com/pins/model-2b-rev1.html

https://raspiprojekt.de/anleitungen/schaltungen/8-gpios-ansteuern-led.html?showall=1&limitstart=

http://pi4j.com/example/control.html

Mittwoch, 8. April 2015

session 3: breadboards angekommen

nmap windows download und install:
https://nmap.org/download.html



mehrere wlan konfiguration ubuntu:
http://wiki.ubuntuusers.de/WLAN/wpa_supplicant


java installieren falls notwendig:
sudo apt-cache search java
sudo apt-get install <paketname> <paketname> <paketname>


howto java + tomcat:
http://www.element14.com/community/community/raspberry-pi/raspberrypi_projects/blog/2014/05/02/tomcat-on-my-pi


pi4j install && tool:
http://pi4j.com/utility/pi4j.html
http://pi4j.com/install.html

besser install per wget und dpkg (da die andere Installation per curl DOS formatiert ist  ^M):
mkdir test
cd test
wget http://get.pi4j.com/download/pi4j-1.1-SNAPSHOT.deb
sudo dpkg --install pi4j-1.1-SNAPSHOT.deb


GPIO Port belegung:
http://pi4j.com/pins/model-2b-rev1.html


Beispiel 1 LED leuchten lassen:
nano /opt/pi4j/examples/ControlGpioExample.java
pi4j --compile /opt/pi4j/examples/ControlGpioExample.java
#+ javac -classpath '.:classes:*:classes:/opt/pi4j/lib/*' -d . /opt/pi4j/examples/ControlGpioExample.java
pi4j --run ControlGpioExample





Pi getoastet und riecht komisch: 
@Christian: Bitte Sensor mitbringen.














Mittwoch, 11. März 2015

Session 2: 20150311 Hardware ist angekommen und wird installiert



Image auf microsdhc Karte spielen:
Win32DiskImager

Image (vorher entpacken):
2015-02-16-raspbian-wheezy.zip

Konsolen Font Größe ändern:
http://www.raspberrypi-spy.co.uk/2014/04/how-to-change-the-command-line-font-size/

(W)Lan einrichten:
http://www.datenreise.de/raspberry-pi-wlan-einrichten-edimax/

sudo nano /etc/network/interfaces (über X-Server nicht mehr editierbar)
auto lo
iface lo inet loopback
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.1.150
netmask 255.255.255.0
gateway 192.168.1.1
#allow-hotplug wlan0
#iface wlan0 inet manual
#wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
auto wlan0
allow-hotplug wlan0
#iface wlan0 inet dhcp
iface wlan0 inet static
address 192.168.1.140
netmask 255.255.255.0
gateway 192.168.1.1
wpa-ap-scan 1
wpa-scan-ssid 1
wpa-ssid "xxxxxxxxx"
wpa-psk "xxxxxxxxxx"


GUI starten:
startx

GUI schliessen (nach Änderung Font Größe):
CTRL-ALT-Backspace



raspberry pi B+ / 2 breadboard GPIO (general purpose input output) Beschriftung:
Raspberry-Pi-GPIO-Layout-Model-B-Plus-rotated-2700x900






LED steuern  über GPIO:
https://raspiprojekt.de/anleitungen/schaltungen/8-gpios-ansteuern-led.html?showall=1&limitstart=
http://raspberrypiguide.de/howtos/raspberry-pi-gpio-how-to/


Ziele:
  • Bringen Sie eine LED zum leuchten ✔
  • Schalten Sie eine LED ein und aus ✔

Java oder Python Anbindung:
  • Lassen Sie eine LED blinken
  • Lassen Sie eine LED blitzen
  • Lassen Sie zwei LEDs abwechselnd blinken (Wechselblinker)
https://blogs.oracle.com/hinkmond/entry/rpi_and_java_embedded_gpio3
http://pi4j.com/example/control.html



-------------------------------

Nachtrag:
Mehrere WLAN Accesspoints konfigurieren:
http://strobelstefan.org/?p=21
ab Schritt 4