Giter Club home page Giter Club logo

raspiarduino's Introduction

RasPiArduino Build Status

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

Arduino Framework for RaspberryPI

Features

  • The familiar Arduino API
  • pinMode/digitalRead/digitalWrite/analogWrite
  • Full SPI, Wire and Serial compatibility
  • Access to STDIN/STDOUT through the Console class
  • Access to system tty through the TTY library
  • Process, FileIO, Client, Server and UDP implementations through the Bridge library

Instructions for Arduino IDE

  • Open the installation folder of Arduino IDE
  • Create a folder named "RaspberryPi" inside "hardware" and clone the repository to a folder named "piduino"
mkdir hardware/RaspberryPi
cd hardware/RaspberryPi
git clone https://github.com/me-no-dev/RasPiArduino piduino
  • Download , extract and copy the toolchain to piduino/tools/arm-linux-gnueabihf
  • Restart Arduino IDE and select the RaspberryPI from the list of boards
  • Compile a sketch
  • Select the RaspberryPi from the list of Ports (will show the IP address)
  • Upload your sketch and see it go

Instructions for the PI

  • Install Raspbian Jessie on your RaspberryPI
  • Gain root permissions
sudo su
  • Enable password login for root
passwd
  • enter the new root password twice
  • Edit /etc/ssh/sshd_config and make sure that the following lines exist and are not commented
PermitRootLogin yes
PasswordAuthentication yes
  • Disable Serial Console on boot by removing console=/dev/ttyAMA0 from /boot/cmdline.txt (or through raspi-config)

  • Disable Serial tty

systemctl disable serial-getty@ttyAMA0
  • Disable loading sound kernel module
sed -i "s/dtparam=audio=on/#dtparam=audio=on/" /boot/config.txt
  • Change the hostname for your Pi (optional) (also through raspi-config)
hostnamectl set-hostname piduino
  • Setup WiFi (optional)
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
  • Setup avahi service to allow updating the sketch from ArduinoIDE
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
  • Install telnet and git
apt-get update
apt-get install telnet git
  • Copy all files from tools/arpi_bins to /usr/local/bin
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
  • Create symbolic link for run-avrdude
ln -s /usr/local/bin/run-avrdude /usr/bin/run-avrdude
  • Synchronize time and start sketch on boot (optional)
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
  • Prevent some RealTek USB WiFi from sleep (optional) (EU)
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
  • Disable screen blank (optional)
sed -i "s/BLANK_TIME=30/BLANK_TIME=0/" /etc/kbd/config
sed -i "s/POWERDOWN_TIME=30/POWERDOWN_TIME=0/" /etc/kbd/config
  • Do not load I2C UART or SPI kernel drivers

  • reboot

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

raspiarduino's People

Contributors

eakoning avatar gitter-badger avatar me-no-dev avatar moelski avatar nkolban avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

raspiarduino's Issues

Library: LedControl fails after a period of time

I am running the LedControl library found here:

https://github.com/wayoda/LedControl

I am using a MAX7219 with an 8x8 matrix. When I run the sample, it all runs for a period of time and then ... after about 5-10 minutes ... the 8x8 matrix goes dark. I haven't yet diagnosed the problem ... I don't know if the signals from the Pi have gone wrong or whether I have a faulty MAX7219 ... The Sketch running on the Pi does not crash or stop running. If I stop the Sketch and then immediately restart it, the display immediately starts responding for 5-10 minutes ... until it doesn't any longer.

Constructors in C++ classes called before init() called

In our project, there is a method called init() which sets up the global environment including registers for the BCM2835. If we link in a sketch, if the sketch has global variables which are instances of C++ classes then their constructors run ... which assumes the envrionment is ready .... but it isn't as the constructors run before main() is given control.

For example:

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  printf("In setup!\n");
  // set up the LCD's number of columns and rows:
 /lcd.begin(16, 2);
  // Print a message to the LCD.
 /lcd.print("hello, world!");
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print(millis() / 1000);
}

Notice the constructor at the top for the instance of the LiquidCrystal object.

README.md is a bit short

Would be great to read what this project is all about. Can it be used to run Arduino sketches on the Raspberry Pi? If so, how?

Serial on PI2B using PIXEL version of Raspian

Tried the RasPiArduino on a Pixel version of Raspbian and it fails every time I try to use the ttl serial (Pins 8,10). I2C and Digital IO still seems to be ok.

I reverted back to Raspbian from about may 2016 and everything worked great so it looks like the RPI folks have changed something.

MFRC522 library not yet working ...

There is a popular library found here ... https://github.com/miguelbalboa/rfid for interacting with RFID devices. It compiled cleanly but when I run it, we appear to get all sorts of timing problems. Here are two distinct runs:

MFRC522 Software Version: 0x91 = v1.0
Scan PICC to see UID, type, and data blocks...
Card UID: 2B 3A 0A 3B
PICC type: MIFARE 1KB
Sector Block   0  1  2  3   4  5  6  7   8  9 10 11  12 13 14 15  AccessBits
  15     63  PCD_Authenticate() failed: Timeout in communication.
  14     59   00 00 00 00  00 00 FF 07  80 69 FF FF  FF FF FF FF  [ 0 0 1 ]
         58  MIFARE_Read() failed: Timeout in communication.
         57  MIFARE_Read() failed: Timeout in communication.
         56  MIFARE_Read() failed: Timeout in communication.
  13     55  PCD_Authenticate() failed: Timeout in communication.
  12     51  PCD_Authenticate() failed: Error in communication.
  11     47  PCD_Authenticate() failed: Timeout in communication.
  10     43  PCD_Authenticate() failed: Timeout in communication.
   9     39  MIFARE_Read() failed: Timeout in communication.
   9     38  PCD_Authenticate() failed: Timeout in communication.
   8     35  PCD_Authenticate() failed: Timeout in communication.
   7     31  PCD_Authenticate() failed: Timeout in communication.
   6     27  PCD_Authenticate() failed: Timeout in communication.
   5     23  PCD_Authenticate() failed: Timeout in communication.
   4     19  PCD_Authenticate() failed: Collission detected.
   3     15  PCD_Authenticate() failed: Timeout in communication.
   2     11  PCD_Authenticate() failed: Timeout in communication.
   1      7  PCD_Authenticate() failed: Timeout in communication.
   0      3  PCD_Authenticate() failed: Timeout in communication.

and another:

Card UID: 2B 3A 0A 3B
PICC type: MIFARE 1KB
Sector Block   0  1  2  3   4  5  6  7   8  9 10 11  12 13 14 15  AccessBits
  15     63   00 00 00 00  00 00 FF 07  80 69 FF FF  FF FF FF FF  [ 0 0 1 ]
         62  MIFARE_Read() failed: Timeout in communication.
         61   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  [ 0 0 0 ]
         60   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  [ 0 0 0 ]
  14     59  PCD_Authenticate() failed: Timeout in communication.
  13     55   00 00 00 00  00 00 FF 07  80 69 FF FF  FF FF FF FF  [ 0 0 1 ]
         54   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  [ 0 0 0 ]
         53  MIFARE_Read() failed: A MIFARE PICC responded with NAK.
         52  MIFARE_Read() failed: The CRC_A does not match.
  12     51  PCD_Authenticate() failed: Timeout in communication.
  11     47  PCD_Authenticate() failed: Timeout in communication.
  10     43  PCD_Authenticate() failed: Timeout in communication.
   9     39  PCD_Authenticate() failed: Error in communication.
   8     35  PCD_Authenticate() failed: Timeout in communication.
   7     31  PCD_Authenticate() failed: Timeout in communication.
   6     27  PCD_Authenticate() failed: Timeout in communication.
   5     23  PCD_Authenticate() failed: Timeout in communication.
   4     19  PCD_Authenticate() failed: Timeout in communication.
   3     15  PCD_Authenticate() failed: Error in communication.
   2     11  PCD_Authenticate() failed: Timeout in communication.
   1      7  PCD_Authenticate() failed: Error in communication.
   0      3  PCD_Authenticate() failed: Timeout in communication.

More testing is required to see where the issue might be.

How to cast to String?

Hi !

Just try to get the ESP8266WebServer running with RasPiArduino. It works but there are some small Problems. One is the casting of int to string for example.
This is the some Code from the webserver:
void PiWebServer::_prepareHeader(String& response, int code, const char* content_type, size_t contentLength) { response = "HTTP/1."+String(_currentVersion)+" "; response += String(code); ...}
The casting of _currentVersion (which is uint8_t) results in an unreadable character.

I found a solution which works:
char buffer[256]; sprintf(buffer, "%d", x);

But maybe there is a more elegant and easier solution?

Dominik

Supplied samples want Console output versions

In a real Arduino there is no console ... if we want to log something, we send it to the Serial output. On the Pi, we have a console. The samples supplied with our project use Serial output for debugging. This issue suggests that, where applicable, second versions of the examples be supplied with the Serial logging replaced by Console logging. These would be net new samples leaving the originals unchanged. No other logic changes would be performed other than Serial -> Console.

Use EthernetServer with Pi network interface

Hi !

I tried to compile the webserver example which works fine. But after looking into the libs I saw that it is all based on the W5100 chip - so the standard ethernet breakout for the arduino.
The Pi has embedded network support so can you give some advice how to use the EthernetServer class with the Pi network interface?

Dominik

Unable to compile in Windows Arduino IDE - ctags_target_for_gcc_minus_e_cpp

On a Windows 10 environment, I am attempting to compile a trivial Arduino Sketch. When I try this, the compilation fails and the error logs shows:

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware "C:\Program Files (x86)\Arduino\hardware" -tools "C:\Program Files (x86)\Arduino\tools-builder" -tools "C:\Program Files (x86)\Arduino\hardware\tools\avr" -built-in-libraries "C:\Program Files (x86)\Arduino\libraries" -libraries "C:\Users\Kolban\Documents\Arduino\libraries" -fqbn=RaspberryPi:piduino:bplus:SerialDestination=disabled,GDBDebug=disabled -ide-version=10609 -build-path "C:\Users\Kolban\AppData\Local\Temp\build9c9ef3bdfe2fccb480bc6e4bac749e41.tmp" -warnings=none -prefs=build.warn_data_percentage=75 -verbose "C:\Program Files (x86)\Arduino\examples\01.Basics\Blink\Blink.ino"
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware "C:\Program Files (x86)\Arduino\hardware" -tools "C:\Program Files (x86)\Arduino\tools-builder" -tools "C:\Program Files (x86)\Arduino\hardware\tools\avr" -built-in-libraries "C:\Program Files (x86)\Arduino\libraries" -libraries "C:\Users\Kolban\Documents\Arduino\libraries" -fqbn=RaspberryPi:piduino:bplus:SerialDestination=disabled,GDBDebug=disabled -ide-version=10609 -build-path "C:\Users\Kolban\AppData\Local\Temp\build9c9ef3bdfe2fccb480bc6e4bac749e41.tmp" -warnings=none -prefs=build.warn_data_percentage=75 -verbose "C:\Program Files (x86)\Arduino\examples\01.Basics\Blink\Blink.ino"
"C:/SysGCC/Raspberry/bin/arm-linux-gnueabihf-g++" "-IC:\Program Files (x86)\Arduino\hardware\RaspberryPi\piduino/tools/compat/include" -D_GNU_SOURCE -O3  -c -MD -pipe -w -x c++ -E -CC -w -DARDUINO=10609 -DARDUINO_RASPI -DARDUINO_ARCH_PIDUINO  -DRASPI "-IC:\Program Files (x86)\Arduino\hardware\RaspberryPi\piduino\cores\piduino" "-IC:\Program Files (x86)\Arduino\hardware\RaspberryPi\piduino\variants\bplus" "C:\Users\Kolban\AppData\Local\Temp\build9c9ef3bdfe2fccb480bc6e4bac749e41.tmp\sketch\Blink.ino.cpp" -o "nul"
"C:/SysGCC/Raspberry/bin/arm-linux-gnueabihf-g++" "-IC:\Program Files (x86)\Arduino\hardware\RaspberryPi\piduino/tools/compat/include" -D_GNU_SOURCE -O3  -c -MD -pipe -w -x c++ -E -CC -w -DARDUINO=10609 -DARDUINO_RASPI -DARDUINO_ARCH_PIDUINO  -DRASPI "-IC:\Program Files (x86)\Arduino\hardware\RaspberryPi\piduino\cores\piduino" "-IC:\Program Files (x86)\Arduino\hardware\RaspberryPi\piduino\variants\bplus" "C:\Users\Kolban\AppData\Local\Temp\build9c9ef3bdfe2fccb480bc6e4bac749e41.tmp\sketch\Blink.ino.cpp" -o "nul"
"C:/SysGCC/Raspberry/bin/arm-linux-gnueabihf-g++" "-IC:\Program Files (x86)\Arduino\hardware\RaspberryPi\piduino/tools/compat/include" -D_GNU_SOURCE -O3  -c -MD -pipe -w -x c++ -E -CC -w -DARDUINO=10609 -DARDUINO_RASPI -DARDUINO_ARCH_PIDUINO  -DRASPI "-IC:\Program Files (x86)\Arduino\hardware\RaspberryPi\piduino\cores\piduino" "-IC:\Program Files (x86)\Arduino\hardware\RaspberryPi\piduino\variants\bplus" "C:\Users\Kolban\AppData\Local\Temp\build9c9ef3bdfe2fccb480bc6e4bac749e41.tmp\sketch\Blink.ino.cpp" -o "C:\Users\Kolban\AppData\Local\Temp\build9c9ef3bdfe2fccb480bc6e4bac749e41.tmp\preproc\ctags_target_for_gcc_minus_e.cpp"
exit status 1
Error compiling for board RaspberryPI B+/2.

It has been 6 months since I played with this environment and have re-installed all tools to latest levels. I was attempting to track down an issue reported by user "zaukkoo" in the forum thread found here ... https://www.raspberrypi.org/forums/viewtopic.php?f=33&t=134928 where he too reported the exact same symptom ... see his post 2016-07-07.

Use gdb to debug a sketch

In the Pi environment we have access to the gdb source code debugger which can be run locally or remotely. It would seem to be possible to run gdbserver on the Pi and gdb on the PC to attach a remote debugger to the Pi to debug the execution of the sketch. Quite how we will accomplish this is not yet known ... this issue is to track progress on that possibility.

Provide over-ride that sends Serial data to Console

On the Arduino which has no screen/keyboard output device, diagnostics and logging and output are sent via the Serial line. This means that if we take an arbitrary sketch from the Internet, the chances are extremely high that it will contain Serial API calls in it that are expected to be viewed by a serial device. This issue suggests the inclusion of a new feature that will be a run-time flag to a compiled Arduino sketch. What it will do is detect that the user who is running the sketch wishes the Serial output to be sent to the Console.

I am imagining an environment variable ... eg. ARDUINO_SERIAL_TO_CONSOLE which, if set to true or 1 would cause any Serial I/O performed by a sketch to be redirected to the Console.

Using port other than ttyAMA0 for console

Hi Neil

I have a SC16is750 I2C UART installed on my Pi (as /dev/ttySC0) that I'd like to use as a serial port in the RasPiArduino environment.

Can you give me some pointers as to how I could go about doing that?

I see the TTY.cpp library, which seems to refer to /dev/tty, but don't understand how that relates to HardwareSerial.cpp which refers to actual RPi GPIO?

Choose compile time symbolic for the "PiDuino" board

From the Arduino IDE perspective, the Pi appears as a new board type. When a sketch is being compiled the sketch can make reference to the "type" of board it is being compiled for. An example of this can be see here in the popular "firmata" project:

https://github.com/firmata/arduino/blob/master/Boards.h

In there, we find the existence of some boards by name. These include:

  • __AVR_ATmega168__
  • __AVR_ATmega328P__
  • __AVR_ATmega328__
  • __AVR_ATmega8__
  • __AVR_ATmega1280__
  • __AVR_ATmega2560__
  • __SAM3X8E__
  • ARDUINO_SAMD_MKR1000
  • _VARIANT_ARDUINO_ZERO_
  • _VARIANT_ARDUINO_101_X_
  • __AVR_AT90USB162__
  • ARDUINO_LINUX
  • __AVR_ATmega644P__
  • __AVR_ATmega644__
  • __AVR_ATmega645__
  • ... and many others

What we need to design is a symbolic that can be referenced within a sketch compiled for PiDuino that allows the compilation to know that it is being compiled for a PiDuino.

Here are some possibilities for consideration:

  • __PIDUINO__
  • __RASPBERRY_PI__

I would further suggest that we have a second variable that identifies the model of Raspberry Pi. Possibilities for consideration include:

  • __VARIANT_PI_A__
  • __VARIANT_PI_B__
  • __VARIANT_PI_A_PLUS__
  • __VARIANT_PI_B_PLUS__
  • __VARIANT_PI_2_B__
  • __VARIANT_PI_ZERO__

Once we choose and lock down some definitions, we can then approach some of the more popular packages and issue pull requests with the PiDuino definitions added.

Compiler warnings needs tuned from defaults

When we compile Sketches for the Pi using the current build system, we end up with failures when importing some libraries and sketches. It appears that the compiler warning levels need tuned for compatibility with what is the "norm" in a real Arduino environment. This issue will capture, log, discuss and address these considerations.

Using File variable twice results in error

Hi !

Maybe I´m doing something wrong but this code did not work:

  File script = FileSystem.open("wlan-stats.sh", FILE_WRITE);
  script.print("#!/bin/sh\n");
  script.print("ifconfig wlan0 | grep 'RX bytes'\n");
  script.close();  // close the file

  script = FileSystem.open("wlan-stats2.sh", FILE_WRITE);
  script.print("#!/bin/sh\n");
  script.print("ifconfig wlan0 | grep 'RX bytes'\n");
  script.close();  // close the file

It results in this error:

*** Error in `./FileWriteScript.ino.bplus.bin': double free or corruption (out): 0xb6300480 ***

Any idea what´s going wrong here ?

Dominik

Ambiguous overload for print(uint64_t)

Withing the HelloWorld.cpp test of LiquidCrystal, we have a statement that reads:

lcd.print(millis() / 1000);

This is throwing a GCC error:

HelloWorld.cpp:59:28: error: call of overloaded ‘print(uint64_t)’ is ambiguous

Raspberry Pi2 latest version

Problems,

BLINK sketch - running often kills the Pi's network connection... just a blink sketch - pin 18 - flashing on and off - first time I've ever had a Pi die on me.

Your software downloaded and setup today.

Logic can infinite loop while using Wire API incorrectly.

I recently came across a sketch that had coded:

Wire.beginTransmission(0x77);
Wire.receiveFrom(0x77, 1);
...

In principle, this is bad logic as we are asking for the start of an I2C write and then immediately asking for the star of an I2C read... however, despite being bad, it shouldn't crash (lock up) the logic. When Wire.receiveFrom is called in this example, it locks up and does not return. Nothing is transmitted on the I2C bus.

getBoardRev returns an unknown board

In Arduino.c 390 - init_pins ... the value returned by getBoardRev() with my Pi 2 is 0xA21041. This generates an out of bounds when trying to access pinmasks.

Missing definition for pthread_setname_np

When we build a sketch, there is now a warning that pthread_setname_np() is undefined. This can be found in wiring_thread.c. Checking the man page here, http://man7.org/linux/man-pages/man3/pthread_setname_np.3.html, it seems that this requires the definition of the symbol _GNU_SOURCE. This issues requests a resolution for a clean compile by either adding the symbol definition as needed or else removing / replacing the function call that is creating the undefined.

Normalize project names and locations ...

It is believed that we wish to name the project "PiDuino" ... we need to solidly check that there isn't such a thing already ... and if there is, choose another name.

In addition, we want to ask the question "Should this project be hosted under a project group as opposed to a named individual (currently 'me-no-dev')"?

Pre-compiled code for core functions and utilities

This issue suggests the construction of pre-compiled code for PiDuino supplied C source. The high level is that all the C and CPP supplied with PiDuino that constitutes the Core libraries and utilities be pre-compiled and placed in an archive for linking. This will be either (or both) a static library or a dynamic shared library.

The thinking is two fold:

  1. There is no obvious reason that this code need be compiled each time that a new user supplied sketch is built. When a new sketch is supplied, we should only compile that sketch and "link" with the library.
  2. By creating a library of the core, we now have the opportunity for code developers who merely wish to use the PiDuino libraries without going through the Arduino IDE to do so simply by compiling their own code and linking with the PiDuino library.

An initial thought on the name of the library is:

  • libPiDuino.a - Static library
  • libPiDuino.so - Shared library

The impact of this issue is high. It will change the core nature of the project. The build environment for the IDE will change and the project will now also have to include an extra build system for those that wish to build the library from the supplied source.

Serial does not work from Arduino Sketch on Raspbian Pixel

Tried the RasPiArduino on a Pixel version of Raspbian and it fails every time I try to use the ttl serial (Pins 8,10). I2C and Digital IO still seems to be ok.

I reverted back to Raspbian from about may 2016 and everything worked great so it looks like the RPI folks have changed something.

replace killall with pkill

I was struggling with the first steps because of the linux version i use on my pi's.
Im using minibian and there is no killall installed by default.
I could install killall with command apt-get install psmisc but pkill is installed by default.

hope to have some time soon to test & implement this...

Add support for analog to digital conversion ...

While the Pi does not have any in-built analog to digital conversion, there are sets of well known integrated circuits that can be wired into a Pi solution that provide ADC. This issue suggests that we choose some ADC ICs, describe some sample circuits and provide user selectable "mappings" to driver code that will drive those ICs to provide ADC. Thus should a sketch need analogRead() (see ... https://www.arduino.cc/en/Reference/AnalogRead) ... then the ADC IC would be driven and the result would come up through the analogRead() output.

Example sketch Bridge -> Process not working

There is a sample sketch provided as part of the Bridge library called "Process". It is supposed to run the curl app and log its response and then cat the cpuinfo file. Both of these are supposed to be logged upon completion. When the sketch is run, no output appears. This needs further investigation.

Recipe for disabling getty from serial port ...

A default instance of Raspbian has getty running against the serial port. Chances are we don't want to do this if we are using the serial port for the Arduino interfacing. This then says that we want to disable the start up of the getty. One way to do this is to run:

$ sudo systemctl disable serial-getty@ttyAMA0

The current recipe in our README has us edit a boot file. I am wondering if that is needed, can we just use systemctl and which would be a preferred method?

Design choices for runtime configurations ...

When a sketch is compiled in the Arduino IDE on a PC, the result is an executable that can be executed on a Pi. During development, this executable can be "pushed" to the Pi for development time execution. However, once development has been completed, the executable can then be considered "stand alone".

Since the Pi is obviously not a real Arduino, there are substantive differences between the Arduino environment and the Pi environment. In some cases, mappings and choices have to be made. For example, the Pi has no analog to digital input.

At some points during development of a sketch, the PiDuino project provides "mappings" to these options. For example (and this is just an example) for Analog to Digital conversion there are different ICs that can be used which can be connected to different GPIO pins or buses.

This issue asks for the consideration of run-time flags to the PiDuino built executables such that a sketch that is compiled on the PC can be mapped at execution time to a user's desired configuration.

Whether this is done from command line properties, environment variables, configuration files or some other mechanism is one of the design choices. It is suggested that what ever is chosen be consistent for all runtime parameters that we may need.

Part of the design consideration in this issue is that an executable compiled from the Arduino IDE should be "portable" to other user's environments. This may mean the installation of the PiDuino "runtime" support (eg. libraries) but it should also allow a user who obtains a pre-compiled sketch to be able to make runtime configuration changes for his operating environment without having to change and recompile the sketch from source.

Change the text in the boards pull-down

When we use the IDE, in the Boards pull down, the PiDuino lists:

  • RaspberryPi
  • RaspberryPi B+/2

This issue recommends that we change this to:

  • Raspberry Pi
  • Raspberry Pi B+/2

Basically ... the injection of some spaces in the menu names

User can activate wrong pin

A user can currently cal pinMode/digital* on any pin.
Those should be restricted by the pinmask for the particular board.
One resolution is to create different Board configs for each pin layout and have the pinmask defined globally depending on the model selected.

Provide a mechanism in the project to produce a linkable library

With the possibility of being able to build Arduino apps using the Arduino APIs without using the Arduino IDE, it is believed that one option is to create a library (possibly called libPiDuino.so) that contains the core plus libraries of the project. This could then be link edited with a sketch to produce an executable.

This issue asks for the design and development of such a library as part of the project. Presumably this will be the creation of a Makefile in some directory structure within the project which will not interfere with Arduino IDE operation. When run, the build will produce the desired libraries.

An example of an end-user session would be:

  1. User creates a source file using vi (or some other editor)
    $ vi myProg.cpp
#include <Arduino.h>

int main(int argc, char *argv[]) {
  pinMode(pinNumber, OUTPUT);
  while(1) {
   digitalWrite(pinNumber, HIGH);
   delay(500);
   digitalWrite(pinNumber, LOW);
   delay(500);
 }
}
  1. User compiles program on the Pi
    $ g++ myProg.cpp -lPiDuino

  2. User runs the program
    $ sudo ./a.out

In order for the above to work, there must be a libPiDuino.so and that is currently the missing piece of the puzzle.

complete all-in-one installation procedure setup.exe for Windows which does all about it

hello,
IMO it would be wishful to have a complete all-in-one installation procedure setup.exe for Windows which does all about installation into the Arduino IDE program folder for the "PiDuino" including all Pi settings which are needed.
You might pack them into a zip file to be downloaded (not git, because that's not common to Windows users).

Then one only had to un-zip,
double-click on setup.exe -

that's it, PiDuino would be ready to use, out of the box !
(i.e. the same as thew whole Arduino setup.exe already works!)

Thanks in advance!

Provide an alternate implementation for Ethernet class that maps to Raspbian TCP

Supplied with the Arduino environment is a class called Ethernet that is purposed for interacting with the Arduino Ethernet Shield. This is a piece of hardware that sits on top of the Arduino that exposes an Ethernet port. When we look at a Raspberry Pi, we find that it either physically has an Ethernet port (all models other than the Pi Zero) or that the Pis don't use an Ethernet connection but instead use a WiFi connection. In all cases, the Raspberry Pi provides the TCP/IP stack on top of the underlying physical environment which is exposed through sockets API at the C programming level.

Currently in PiDuino, we supply the Ethernet class to achieve parity with a real Arduino. This means that if a user actually does have a real-world Ethernet shield for a real-world Arduino, that Ethernet shield could be attached to the Pi and one could use that as an Ethernet connection.

While there is no reason to question that some users will actually derive benefit from that, there is an argument that can be made that says there is an opportunity for an alternative story. Imagine a second implementation of "Ethernet" which instead of driving an Arduino Ethernet shield simply "assumed" that the Pi would provide networking. As such, all the other APIs from the Ethernet class such as Client and Server could be used to perform TCP/IP from a Sketch environment.

This is place holder issue for further examination and discussion of this possibility.

Check for execution as root

An executable built for PiDuino must be run as the root userid. This issue asks for a positive check that the running effective userid is indeed root and, if not, issue a message and perform a graceful exit.

Missing utlity/includes.h

While attempting to build the nRF24 samples, the IDE compilation failed with an error that it was unable to include utility/includes.h. Don't know what this is yet but creating an issue to track.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.