Home

Awesome

RasPiArduino Build Status

Join the chat at https://gitter.im/me-no-dev/RasPiArduino

Includes raspberry_pi_revision from Andrew Duncan

Arduino Framework for RaspberryPI

Features

Instructions for Arduino IDE

mkdir hardware/RaspberryPi
cd hardware/RaspberryPi
git clone https://github.com/me-no-dev/RasPiArduino piduino

Instructions for the PI

sudo su
passwd
PermitRootLogin yes
PasswordAuthentication yes
systemctl disable serial-getty@ttyAMA0
sed -i "s/dtparam=audio=on/#dtparam=audio=on/" /boot/config.txt
hostnamectl set-hostname piduino
cat > /etc/wpa_supplicant/wpa_supplicant.conf <<EOL
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
    ssid="your-ssid"
    psk="your-pass"
}
EOL
cat > /etc/avahi/services/arduino.service <<EOL
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
  <name replace-wildcards="yes">%h</name>
  <service>
    <type>_arduino._tcp</type>
    <port>22</port>
    <txt-record>board=bplus</txt-record>
  </service>
</service-group>
EOL

service avahi-daemon restart
apt-get update
apt-get install telnet git
git clone https://github.com/me-no-dev/RasPiArduino.git piduino
chmod +x piduino/tools/arpi_bins/*
cp piduino/tools/arpi_bins/* /usr/local/bin
rm -rf piduino
ln -s /usr/local/bin/run-avrdude /usr/bin/run-avrdude
apt-get install ntpdate
cat > /etc/rc.local <<EOL
#!/bin/sh -e

_IP=\$(hostname -I) || true
if [ "\$_IP" ]; then
  printf "My IP address is %s\n" "\$_IP"
fi

# Sync Time
ntpdate-debian -u > /dev/null
# Start Sketch
/usr/local/bin/run-sketch > /dev/null

exit 0
EOL
echo "options 8192cu rtw_power_mgnt=0 rtw_enusbss=1 rtw_ips_mode=1" > /etc/modprobe.d/8192cu.conf
echo "options r8188eu rtw_power_mgnt=0 rtw_enusbss=1 rtw_ips_mode=1" > /etc/modprobe.d/r8188eu.conf
sed -i "s/BLANK_TIME=30/BLANK_TIME=0/" /etc/kbd/config
sed -i "s/POWERDOWN_TIME=30/POWERDOWN_TIME=0/" /etc/kbd/config

If everything went well

Selecting the board from the list of ports

Select Pi Port

Password prompt before upload

Enter Pi Pass

Monitoring the sketch

Sketch Monitor

Links to external tutorials