Lope Posted March 1, 2019 Posted March 1, 2019 (edited) I'm not sure I even want BakeBit. I'm trying to use the GPIO in my NanoPi Neo2. Specifically I want to read a digital I/O pin on/off state. And if possible I'd like to read an analog voltage from the H5's built in ADC. Now that I've looked deeper into BakeBit, it seems like the entire purpose of BakeBit is to do GPIO with an Arduino, and read the information remotely on a RbPi/NanoPi or whatever ON the Arduino's GPIO pins. If that is really what BakeBit is, then BakeBit doesn't interest me. The H5 already has GPIO and an ADC. We just need to get that working. For interest's sake, here is the progress I made with BakeBit. ADC Python example in Bakebit http://wiki.friendlyarm.com/wiki/index.php/BakeBit_-_Light_Sensor i had to `apt-get install libjpeg-dev zlib1g-dev` to get pillow to install properly, which is a dependency of BakeBit. Bakebit installed without errors, but it tries to compile WiringNP which complained with a lot of warnings. In the following thread I got WiringNP to run. This was semi useful BTWhttps://www.cnx-software.com/2017/05/21/using-gpios-on-nanopi-neo-2-board-with-bakebit-starter-kit/ Now when I `rm -rf the bakebit dir` then do a fresh clone and `/scripts/BakeBit/Script/install.sh` it installs without errors except warnings for WiringNP. (which I don't actually get when I build it myself) Spoiler wiringPi Build script ===================== WiringPi Library [UnInstall] [Compile] boardtype_friendlyelec.c boardtype_friendlyelec.c: In function ‘getFieldValueInCpuInfo’: boardtype_friendlyelec.c:134:43: warning: suggest parentheses around assignment used as truth value [-Wparentheses] GetKeyValue(isGotHardware,p,"Hardware",hardware,hardwareMaxLen); ^ boardtype_friendlyelec.c:123:25: note: in definition of macro ‘GetKeyValue’ if (valP=strtok(line2, ":")) { \ ^~~~ boardtype_friendlyelec.c:134:43: warning: suggest parentheses around assignment used as truth value [-Wparentheses] GetKeyValue(isGotHardware,p,"Hardware",hardware,hardwareMaxLen); ^ boardtype_friendlyelec.c:125:33: note: in definition of macro ‘GetKeyValue’ if (valP=strtok(0, ":")) { \ ^~~~ boardtype_friendlyelec.c:135:43: warning: suggest parentheses around assignment used as truth value [-Wparentheses] GetKeyValue(isGotRevision,p2,"Revision",revision,revisionMaxLen); ^ boardtype_friendlyelec.c:123:25: note: in definition of macro ‘GetKeyValue’ if (valP=strtok(line2, ":")) { \ ^~~~ boardtype_friendlyelec.c:135:43: warning: suggest parentheses around assignment used as truth value [-Wparentheses] GetKeyValue(isGotRevision,p2,"Revision",revision,revisionMaxLen); ^ boardtype_friendlyelec.c:125:33: note: in definition of macro ‘GetKeyValue’ if (valP=strtok(0, ":")) { \ ^~~~ boardtype_friendlyelec.c:136:65: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if (isGotRevision==0) GetKeyValue(isGotRevision,p2,"CPURevision",revision,revisionMaxLen); ^ boardtype_friendlyelec.c:123:25: note: in definition of macro ‘GetKeyValue’ if (valP=strtok(line2, ":")) { \ ^~~~ boardtype_friendlyelec.c:136:65: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if (isGotRevision==0) GetKeyValue(isGotRevision,p2,"CPURevision",revision,revisionMaxLen); ^ boardtype_friendlyelec.c:125:33: note: in definition of macro ‘GetKeyValue’ if (valP=strtok(0, ":")) { \ ^~~~ boardtype_friendlyelec.c: In function ‘getAllwinnerBoardID’: boardtype_friendlyelec.c:178:21: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if (p = strtok(line, ":")) { ^ boardtype_friendlyelec.c:181:29: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if (p = strtok(0, ":")) { ^ [Link (Dynamic)] [Install Headers] [Install Dynamic Lib] WiringPi Devices Library [UnInstall] make: Nothing to be done for 'all'. [Install Headers] [Install Dynamic Lib] GPIO Utility [Compile] readall.c readall.c: In function ‘readallPhys’: readall.c:562:16: warning: implicit declaration of function ‘getAltSilence’; did you mean ‘getline’? [-Wimplicit-function-declaration] int alt = getAltSilence (pin); ^~~~~~~~~~~~~ getline readall.c:569:23: warning: implicit declaration of function ‘digitalReadSilence’; did you mean ‘digitalRead’? [-Wimplicit-function-declaration] printf (" | %d", digitalReadSilence (pin)) ; ^~~~~~~~~~~~~~~~~~ digitalRead [Link] [Install] All Done. NOTE: To compile programs with wiringNP, you need to add: -lwiringPi to your compile line(s). WiringNP Installed The user `root' is already a member of `i2c'. Install smbus for python Reading package lists... Done Building dependency tree Reading state information... Done python-smbus is already the newest version (4.0-2). 0 upgraded, 0 newly installed, 0 to remove and 27 not upgraded. Making libraries global . . . With the hax I did to get WiringNP to work on my Neo2. I deleted Bakebit/Scripts/WiringNP and replaced it with the version that I modified and built successfully. Edited March 2, 2019 by Tido added spoiler - please add a spoiler nexttime yourself, thx
Recommended Posts