diff --git a/SD/FPP_Install.sh b/SD/FPP_Install.sh index 2432a7790..b3932171b 100755 --- a/SD/FPP_Install.sh +++ b/SD/FPP_Install.sh @@ -177,7 +177,12 @@ then desktop=false elif [ -e "/sys/class/leds/beaglebone:green:usr0" ] then + ARCH=$(uname -m) +if [ "$ARCH" == "aarch64" ]; then + FPPPLATFORM="BeagleBone 64" +else FPPPLATFORM="BeagleBone Black" +fi isimage=true desktop=false elif [ -f "/etc/armbian-release" ] @@ -382,27 +387,15 @@ cd /opt 2> /dev/null || mkdir /opt export DEBIAN_FRONTEND=noninteractive case "${OSVER}" in - debian_11 | debian_12 | ubuntu_22.* | ubuntu_24.* | linuxmint_21) - case $FPPPLATFORM in - 'BeagleBone Black') - echo "FPP - Skipping non-free for $FPPPLATFORM" - ;; - *) - echo "FPP - Enabling non-free repo" - sed -i -e "s/Components: main/Components: main contrib non-free non-free-firmware/" /etc/apt/sources.list.d/debian.sources - #sed -i -e "s/^deb \(.*\)/deb \1 non-free/" /etc/apt/sources.list - #sed -i -e "s/non-free\(.*\)non-free/non-free\1/" /etc/apt/sources.list - ;; - esac - + debian_12 | ubuntu_24.* | linuxmint_21) #remove a bunch of packages that aren't neeeded, free's up space PACKAGE_REMOVE="nginx nginx-full nginx-common python3-numpy python3-opencv python3-pip python3-pkg-resources python3-scipy triggerhappy pocketsphinx-en-us python3-smbus guile-2.2-libs \ python3-werkzeug python3-click python3-colorama python3-decorator python3-dev python3-distro \ python3-flask python3-itsdangerous python3-jinja2 python3-lib2to3 python3-libgpiod python3-markupsafe \ gfortran glib-networking libxmuu1 xauth network-manager dhcpcd5 fake-hwclock ifupdown isc-dhcp-client isc-dhcp-common openresolv iwd" - if [ "$FPPPLATFORM" == "BeagleBone Black" ]; then - PACKAGE_REMOVE="$PACKAGE_REMOVE nodejs bb-node-red-installer mender-client" + if [ "$FPPPLATFORM" == "BeagleBone 64" -o "$FPPPLATFORM" == "BeagleBone Black" ]; then + PACKAGE_REMOVE="$PACKAGE_REMOVE nodejs bb-node-red-installer mender-client bb-code-server nginx nginx-common" fi if $desktop; then #don't remove anything from a desktop @@ -499,7 +492,7 @@ case "${OSVER}" in samba rsync sudo shellinabox dnsmasq hostapd vsftpd ntp sqlite3 at haveged samba samba-common-bin \ mp3info exim4 mailutils dhcp-helper parprouted bridge-utils libiio-utils libfmt9 \ php${PHPVER} php${PHPVER}-cli php${PHPVER}-fpm php${PHPVER}-common php${PHPVER}-curl php-pear \ - php${PHPVER}-bcmath php${PHPVER}-sqlite3 php${PHPVER}-zip php${PHPVER}-xml \ + php${PHPVER}-bcmath php${PHPVER}-sqlite3 php${PHPVER}-zip php${PHPVER}-xml ccache \ libavcodec-dev libavformat-dev libswresample-dev libswscale-dev libavdevice-dev libavfilter-dev libtag1-dev \ vorbis-tools libgraphicsmagick++1-dev graphicsmagick-libmagick-dev-compat libmicrohttpd-dev \ gettext apt-utils x265 libtheora-dev libvorbis-dev libx265-dev iputils-ping mp3gain \ @@ -507,15 +500,15 @@ case "${OSVER}" in fonts-freefont-ttf flex bison pkg-config libasound2-dev mesa-common-dev qrencode libusb-1.0-0-dev \ flex bison pkg-config libasound2-dev python3-setuptools libssl-dev libtool bsdextrautils iw rsyslog tzdata" - if [ "$FPPPLATFORM" == "Raspberry Pi" -o "$FPPPLATFORM" == "BeagleBone Black" ]; then + if [ "$FPPPLATFORM" == "Raspberry Pi" -o "$FPPPLATFORM" == "BeagleBone Black" -o "$FPPPLATFORM" == "BeagleBone 64" ]; then PACKAGE_LIST="$PACKAGE_LIST firmware-realtek firmware-atheros firmware-ralink firmware-brcm80211 firmware-iwlwifi firmware-libertas firmware-zd1211 firmware-ti-connectivity zram-tools" - if [ "${OSVER}" == "debian_12" ]; then - PACKAGE_LIST="$PACKAGE_LIST ccache" + if [ "$FPPPLATFORM" == "Raspberry Pi" ]; then + PACKAGE_LIST="$PACKAGE_LIST libva-dev smartmontools" + fi + if [ "$FPPPLATFORM" == "BeagleBone Black" -o "$FPPPLATFORM" == "BeagleBone 64" ]; then + PACKAGE_LIST="$PACKAGE_LIST ti-pru-cgt-v2.3" fi else - PACKAGE_LIST="$PACKAGE_LIST ccache" - fi - if [ "$FPPPLATFORM" != "BeagleBone Black" ]; then PACKAGE_LIST="$PACKAGE_LIST libva-dev smartmontools" fi if $isimage; then @@ -546,15 +539,7 @@ case "${OSVER}" in (cd /opt/ && git clone https://github.com/tomba/kmsxx && cd kmsxx && apt-get install -y meson cmake libfmt-dev && meson setup build --prefix=/usr -Dpykms=disabled && ninja -C build install && cd /opt/ && rm -rf kmsxx && apt-get remove -y --purge --autoremove meson cmake libfmt-dev && ccache -C) if $isimage; then - if [ "${OSVER}" == "debian_12" ]; then - apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install systemd wpasupplicant - elif [ "$FPPPLATFORM" == "BeagleBone Black" ]; then - # Since we rely heavily on systemd-networkd and wpasupplicant for networking features, grab the latest backports - # This cannot work on Raspberry Pi as the Pi Zero and older Pi's are armv6 and bullseye-backports is armv7 - apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -t bullseye-backports install systemd wpasupplicant - else - apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install systemd wpasupplicant - fi + apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install systemd wpasupplicant fi echo "FPP - Cleaning up after installing packages" apt-get -y clean @@ -734,6 +719,11 @@ case "${FPPPLATFORM}" in systemctl disable unattended-upgrades systemctl disable resize_filesystem ;; + 'BeagleBone 64') + systemctl disable keyboard-setup + systemctl disable unattended-upgrades + systemctl disable resize_filesystem + ;; 'Raspberry Pi') echo "FPP - Updating firmware for Raspberry Pi install" @@ -1154,18 +1144,7 @@ sudo sed -i '/user\.\*/s/^/# /' /etc/rsyslog.conf # Configure ccache echo "FPP - Configuring ccache" mkdir -p /root/.ccache -if [ "$FPPPLATFORM" == "Raspberry Pi" -o "$FPPPLATFORM" == "BeagleBone Black" ]; then - # On Beagle/Pi, we'll use a newer ccache to allow developer sharing of the cache - if [ "x${OSVER}" != "xdebian_12" ]; then - cd /opt/fpp/SD - ./buildCCACHE.sh - ccache -M 350M - else - ccache -M 500M - fi -else - ccache -M 350M -fi +ccache -M 500M ccache --set-config=temporary_dir=/tmp ccache --set-config=sloppiness=pch_defines,time_macros ccache --set-config=hard_link=true @@ -1361,6 +1340,13 @@ sed -i '/^pool.*/d' /etc/ntpsec/ntp.conf sed -i '$s/$/\npool falconplayer.pool.ntp.org iburst minpoll 8 maxpoll 12 prefer/' /etc/ntpsec/ntp.conf +if [ "x${FPPPLATFORM}" = "xBeagleBone 64" ]; then + #Set colored prompt + sed -i -e "s/#force_color_prompt=yes/force_color_prompt=yes/" /home/fpp/.bashrc + # remove the udev rules that create the SoftAp interface on the bbbw and bbggw + rm -f /etc/udev/rules.d/*SoftAp* + +fi if [ "x${FPPPLATFORM}" = "xBeagleBone Black" ]; then ####################################### systemctl disable dev-hugepages.mount @@ -1379,10 +1365,7 @@ if [ "x${FPPPLATFORM}" = "xBeagleBone Black" ]; then make -j ${CPUS} make install make clean - - # install the newer pru code generator - apt-get install ti-pru-cgt-v2.3 - + #Set colored prompt sed -i -e "s/#force_color_prompt=yes/force_color_prompt=yes/" /home/fpp/.bashrc @@ -1483,20 +1466,7 @@ make clean ; make -j ${CPUS} optimized ###################################### -if [ "$FPPPLATFORM" == "Raspberry Pi" -o "$FPPPLATFORM" == "BeagleBone Black" ]; then - if [ "x${OSVER}" != "xdebian_12" ]; then - if [ "$FPPPLATFORM" == "Raspberry Pi" ]; then - echo "FPP - Install kernel headers so modules can be compiled later" - apt-get -y install raspberrypi-kernel-headers - apt-get clean - fi - - echo "FPP - Compiling WIFI drivers" - cd /opt/fpp/SD - bash ./FPP-Wifi-Drivers.sh - rm -f /etc/modprobe.d/rtl8723bu-blacklist.conf - fi - +if [ "$FPPPLATFORM" == "Raspberry Pi" -o "$FPPPLATFORM" == "BeagleBone Black" -o "$FPPPLATFORM" == "BeagleBone 64" ]; then # replace entry already there sed -i 's/^DAEMON_CONF.*/DAEMON_CONF="\/etc\/hostapd\/hostapd.conf"/g' /etc/default/hostapd if ! grep -q etc/hostapd/hostapd.conf "/etc/default/hostapd"; then diff --git a/src/MultiSync.cpp b/src/MultiSync.cpp index e1d919966..66f59880c 100644 --- a/src/MultiSync.cpp +++ b/src/MultiSync.cpp @@ -247,11 +247,11 @@ int MultiSync::Init(void) { RemoveInterface(name); } else if (i == NetworkMonitor::NetEventType::NEW_ADDR && up) { bool changed = FillInInterfaces(); + setupMulticastReceive(true); if (changed) { FillLocalSystemInfo(); Ping(0, false); } - setupMulticastReceive(); } }; NetworkMonitor::INSTANCE.registerCallback(f); @@ -1094,6 +1094,7 @@ void MultiSync::Ping(int discover, bool broadcast) { LogErr(VB_SYNC, "ERROR: Tried to send ping packet but control socket is not open.\n"); return; } + setupMulticastReceive(discover ? true : false); // update the range for local systems so it's accurate const std::vector>& ranges = GetOutputRanges(true); @@ -2059,7 +2060,7 @@ int MultiSync::OpenReceiveSocket(void) { rcvMsgs[i].msg_hdr.msg_controllen = 0x100; } - setupMulticastReceive(); + setupMulticastReceive(false); return 1; } bool MultiSync::isSupportedForMultisync(const char* address, const char* intface) { @@ -2073,7 +2074,7 @@ bool MultiSync::isSupportedForMultisync(const char* address, const char* intface return true; } -void MultiSync::setupMulticastReceive() { +void MultiSync::setupMulticastReceive(bool cycle) { LogDebug(VB_SYNC, "setupMulticastReceive()\n"); // loop through all the interfaces and subscribe to the group std::unique_lock lock(m_socketLock); @@ -2084,9 +2085,12 @@ void MultiSync::setupMulticastReceive() { mreq.imr_multiaddr.s_addr = inet_addr(MULTISYNC_MULTICAST_ADDRESS); mreq.imr_interface.s_addr = a.second.address; int rc = 0; + if (cycle) { + setsockopt(m_receiveSock, IPPROTO_IP, IP_DROP_MEMBERSHIP, &mreq, sizeof(mreq)); + } if ((rc = setsockopt(m_receiveSock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq))) < 0) { if (m_broadcastSock < 0) { - // first time through, log as warning, otherise error is likely due t already being subscribed + // first time through, log as warning, otherwise error is likely due to already being subscribed LogWarn(VB_SYNC, " Could not setup Multicast Group for interface %s rc: %d\n", a.second.interfaceName.c_str(), rc); } else { LogDebug(VB_SYNC, " Could not setup Multicast Group for interface %s rc: %d\n", a.second.interfaceName.c_str(), rc); diff --git a/src/MultiSync.h b/src/MultiSync.h index 8deaf3bd9..6be2b32e0 100644 --- a/src/MultiSync.h +++ b/src/MultiSync.h @@ -305,7 +305,7 @@ class MultiSync { private: bool isSupportedForMultisync(const char* address, const char* intface); - void setupMulticastReceive(); + void setupMulticastReceive(bool cycle); void PingSingleRemote(MultiSyncSystem& sys, int discover = 0); void PingSingleRemoteViaHTTP(const std::string& address); int CreatePingPacket(MultiSyncSystem& sys, char* outBuf, int discover); diff --git a/src/oled/FPPOLEDUtils.cpp b/src/oled/FPPOLEDUtils.cpp index 9b5826836..0f565aed1 100644 --- a/src/oled/FPPOLEDUtils.cpp +++ b/src/oled/FPPOLEDUtils.cpp @@ -200,7 +200,6 @@ FPPOLEDUtils::InputAction* FPPOLEDUtils::configureGPIOPin(const std::string& pin gpiodChips[pin.gpioIdx] = gpiod_chip_open_by_number(pin.gpioIdx); } action->gpiodLine = gpiod_chip_get_line(gpiodChips[pin.gpioIdx], pin.gpio); - struct gpiod_line_request_config lineConfig; lineConfig.consumer = "FPPOLED"; lineConfig.request_type = GPIOD_LINE_REQUEST_DIRECTION_INPUT; @@ -340,7 +339,7 @@ bool FPPOLEDUtils::parseInputActions(const std::string& file) { lineConfig.request_type = GPIOD_LINE_REQUEST_DIRECTION_INPUT; lineConfig.flags = 0; if (gpiod_line_request(action->gpiodLine, &lineConfig, 0) == -1) { - printf("Could not config line as input\n"); + printf("Could not config line as input. idx: %d pin: %d\n", pin.gpioIdx, pin.gpio); } gpiod_line_release(action->gpiodLine); if (edge == "falling") { diff --git a/src/oled/SSD1306DisplayDriver.cpp b/src/oled/SSD1306DisplayDriver.cpp index 4e0ad04f1..680d3ebce 100644 --- a/src/oled/SSD1306DisplayDriver.cpp +++ b/src/oled/SSD1306DisplayDriver.cpp @@ -6,7 +6,7 @@ #include "SSD1306_OLED.h" extern I2C_DeviceT I2C_DEV_2; -#if defined(PLATFORM_BBB) +#if defined(PLATFORM_BBB) || defined(PLATFORM_BB64) #include "util/BBBUtils.h" #define I2C_DEV_PATH I2C_DEV2_PATH #elif defined(PLATFORM_PI) @@ -45,8 +45,8 @@ bool SSD1306DisplayDriver::initialize(int& i2cBus) { } if (ledType && display_Init_seq()) { #ifdef PLATFORM_BBB - //was not able to configure the led on I2C2, lets see if - //it's available on I2C1 + // was not able to configure the led on I2C2, lets see if + // it's available on I2C1 Close_device(I2C_DEV_2.fd_i2c); if (getBeagleBoneType() == BeagleBoneType::PocketBeagle) { PinCapabilities::getPinByName("P2-09").configPin("i2c"); diff --git a/src/oled/fppoled.cpp b/src/oled/fppoled.cpp index 2a3f7a132..1bbfec1db 100644 --- a/src/oled/fppoled.cpp +++ b/src/oled/fppoled.cpp @@ -16,7 +16,7 @@ #include "common.h" #include "settings.h" -#if defined(PLATFORM_BBB) +#if defined(PLATFORM_BBB) || defined(PLATFORM_BB64) #include "util/BBBUtils.h" #define PLAT_GPIO_CLASS BBBPinProvider #elif defined(PLATFORM_PI) diff --git a/src/sensors/IIOSensorSource.cpp b/src/sensors/IIOSensorSource.cpp index ab357ac32..bab9e0780 100644 --- a/src/sensors/IIOSensorSource.cpp +++ b/src/sensors/IIOSensorSource.cpp @@ -71,6 +71,10 @@ IIOSensorSource::~IIOSensorSource() { delete[] readBuffer; } } +bool IIOSensorSource::isOK() const { + return FileExists("/dev/iio:device0"); +} + void IIOSensorSource::Init(std::map>& callbacks) { if (usingBuffers) { if (iioDevFile >= 0) { diff --git a/src/sensors/IIOSensorSource.h b/src/sensors/IIOSensorSource.h index 4fd662876..8e37a123a 100644 --- a/src/sensors/IIOSensorSource.h +++ b/src/sensors/IIOSensorSource.h @@ -27,6 +27,8 @@ class IIOSensorSource : public SensorSource { virtual void enable(int id) override; virtual int32_t getValue(int id) override; + virtual bool isOK() const; + private: void update(bool forceInstant, bool fromSelect); std::vector values; diff --git a/src/sensors/Sensors.cpp b/src/sensors/Sensors.cpp index 9057a8317..20ee047ee 100644 --- a/src/sensors/Sensors.cpp +++ b/src/sensors/Sensors.cpp @@ -381,18 +381,19 @@ void Sensors::addSensorSources(Json::Value& config) { for (int x = 0; x < config.size(); x++) { Json::Value v = config[x]; std::string type = v["type"].asString(); + SensorSource* ss = nullptr; if (type == "ads7828" || type == "ads7830") { - sensorSources.push_back(new ADS7828Sensor(v)); + ss = new ADS7828Sensor(v); } else if (type == "iio") { - sensorSources.push_back(new IIOSensorSource(v)); + ss = new IIOSensorSource(v); } else if (type == "mux") { - MuxSensorSource* m = new MuxSensorSource(v); - if (m->isOK()) { - sensorSources.push_back(m); - } else { - WarningHolder::AddWarning("Could not create MuxSensorSource: " + m->getID()); - delete m; - } + ss = new MuxSensorSource(v); + } + if (ss && ss->isOK()) { + sensorSources.push_back(ss); + } else if (ss) { + WarningHolder::AddWarning("Could not create SensorSource: " + ss->getID()); + delete ss; } } } @@ -413,7 +414,13 @@ SensorSource* Sensors::getSensorSource(const std::string& name) { v["type"] = "iio"; v["id"] = "iio"; SensorSource* ss = new IIOSensorSource(v); - sensorSources.push_back(ss); + if (ss->isOK()) { + sensorSources.push_back(ss); + } else { + WarningHolder::AddWarning("Could not create SensorSource: " + ss->getID()); + delete ss; + ss = nullptr; + } return ss; } return nullptr; diff --git a/src/util/BBBUtils.cpp b/src/util/BBBUtils.cpp index f923d940a..b9fde21c2 100644 --- a/src/util/BBBUtils.cpp +++ b/src/util/BBBUtils.cpp @@ -33,6 +33,8 @@ BeagleBoneType getBeagleBoneType() { BBB_TYPE = SanCloudEnhanced; } else if (strcmp(&buf[10], "PocketBeagle") == 0) { BBB_TYPE = PocketBeagle; + } else if (strcmp(buf, "BeagleBoard.org PocketBeagle2") == 0) { + BBB_TYPE = PocketBeagle; } else if (strcmp(&buf[10], "BeagleBone Black Wireless") == 0) { BBB_TYPE = BlackWireless; } else if (strcmp(&buf[10], "BeagleBone Green Wireless") == 0) { @@ -95,6 +97,17 @@ static void setupBBBMemoryMap() { std::string lab = GetFileContents(fn2 + "/label"); TrimWhiteSpace(lab); std::string target = buf; +#ifdef PLATFORM_BB64 + if (lab.contains("tps65219-gpio")) { + labelMapping[lab] = 0; + } else if (lab.contains("4201000.gpio")) { + labelMapping[lab] = 1; + } else if (lab.contains("600000.gpio")) { + labelMapping[lab] = 2; + } else if (lab.contains("601000.gpio")) { + labelMapping[lab] = 3; + } +#else if (target.contains("44e07000.gpio")) { labelMapping[lab] = 0; } else if (target.contains("4804c000.gpio")) { @@ -104,6 +117,7 @@ static void setupBBBMemoryMap() { } else if (target.contains("481ae000.gpio")) { labelMapping[lab] = 3; } +#endif } } closedir(dir); @@ -112,9 +126,11 @@ static void setupBBBMemoryMap() { for (auto& a : gpiod::make_chip_iter()) { // std::string cname = a.name(); std::string clabel = a.label(); + TrimWhiteSpace(clabel); if (labelMapping.contains(clabel)) { bbGPIOMap[labelMapping[clabel]] = curChip; } else { +#ifdef PLATFORM_BBB // if mapping by base fails, try using specific line labels auto line = a.get_line(0); if (line.name() == "NC") { @@ -132,6 +148,7 @@ static void setupBBBMemoryMap() { bbGPIOMap[3] = curChip; } line.release(); +#endif } ++curChip; if (curChip == 4) { @@ -144,12 +161,18 @@ static void setupBBBMemoryMap() { // ------------------------------------------------------------------------ -BBBPinCapabilities::BBBPinCapabilities(const std::string& n, uint32_t k, uint32_t o) : +BBBPinCapabilities::BBBPinCapabilities(const std::string& n, uint32_t k) : GPIODCapabilities(n, k), pru(-1), pruPin(-1) { setupBBBMemoryMap(); gpioIdx = bbGPIOMap[k / 32]; gpio = k % 32; } +BBBPinCapabilities::BBBPinCapabilities(const std::string& n, uint32_t g, uint32_t o) : + GPIODCapabilities(n, g), pru(-1), pruPin(-1) { + setupBBBMemoryMap(); + gpioIdx = bbGPIOMap[g]; + gpio = o; +} int BBBPinCapabilities::mappedGPIOIdx() const { for (int x = 0; x < 4; x++) { @@ -305,122 +328,199 @@ const PinCapabilities& BBBPinProvider::getPinByGPIO(int i) { void BBBPinProvider::Init() { if (BBB_PINS.empty()) { +#ifdef PLATFORM_BBB + if (getBeagleBoneType() == PocketBeagle) { + BBB_PINS.emplace_back("P1-02", 87).setPRU(1, 9, 6, 5); + BBB_PINS.emplace_back("P1-04", 89).setPRU(1, 11, 6, 5); + BBB_PINS.emplace_back("P1-06", 5).setI2C(1, 2); + BBB_PINS.emplace_back("P1-08", 2).setPwm(0, 0, 3).setUART("ttyS2-rx", 1); + BBB_PINS.emplace_back("P1-10", 3).setPwm(0, 1, 3).setUART("ttyS2-tx", 1); + BBB_PINS.emplace_back("P1-12", 4).setI2C(1, 2); + BBB_PINS.emplace_back("P1-20", 20); + BBB_PINS.emplace_back("P1-26", 12).setI2C(2, 3); + BBB_PINS.emplace_back("P1-28", 13).setI2C(2, 3); + BBB_PINS.emplace_back("P1-29", 117).setPRU(0, 7, 6, 5); + BBB_PINS.emplace_back("P1-30", 43).setPRU(1, 15, 6, 5).setUART("ttyS0-tx", 0); + BBB_PINS.emplace_back("P1-31", 114).setPRU(0, 4, 6, 5); + BBB_PINS.emplace_back("P1-32", 42).setPRU(1, 14, 6, 5).setUART("ttyS0-rx", 0); + BBB_PINS.emplace_back("P1-33", 111).setPRU(0, 1, 6, 5).setPwm(0, 1, 1); + BBB_PINS.emplace_back("P1-34", 26); + BBB_PINS.emplace_back("P1-35", 88).setPRU(1, 10, 6, 5); + BBB_PINS.emplace_back("P1-36", 110).setPRU(0, 0, 6, 5).setPwm(0, 0, 1); + BBB_PINS.emplace_back("P2-01", 50).setPwm(1, 0, 6); + BBB_PINS.emplace_back("P2-02", 59); + BBB_PINS.emplace_back("P2-03", 23).setPwm(2, 1, 4); + BBB_PINS.emplace_back("P2-04", 58); + BBB_PINS.emplace_back("P2-05", 30).setUART("ttyS4-rx", 6); + BBB_PINS.emplace_back("P2-06", 57); + BBB_PINS.emplace_back("P2-07", 31).setUART("ttyS4-tx", 6); + BBB_PINS.emplace_back("P2-08", 60); + BBB_PINS.emplace_back("P2-09", 15).setUART("ttyS1-tx", 0); + BBB_PINS.emplace_back("P2-10", 52); + BBB_PINS.emplace_back("P2-11", 14).setUART("ttyS1-rx", 0); + BBB_PINS.emplace_back("P2-17", 65); + BBB_PINS.emplace_back("P2-18", 47); + BBB_PINS.emplace_back("P2-19", 27); + BBB_PINS.emplace_back("P2-20", 64); + BBB_PINS.emplace_back("P2-22", 46); + BBB_PINS.emplace_back("P2-24", 44).setPRU(0, 14, -1, 6); + BBB_PINS.emplace_back("P2-25", 41).setUART("ttyS4-tx", 1); + BBB_PINS.emplace_back("P2-27", 40).setUART("ttyS4-rx", 1); + BBB_PINS.emplace_back("P2-28", 116).setPRU(0, 6, 6, 5); + BBB_PINS.emplace_back("P2-29", 7).setUART("ttyS3-tx", 1); + BBB_PINS.emplace_back("P2-30", 113).setPRU(0, 3, 6, 5); + BBB_PINS.emplace_back("P2-31", 19); + BBB_PINS.emplace_back("P2-32", 112).setPRU(0, 2, 6, 5); + BBB_PINS.emplace_back("P2-33", 45).setPRU(0, 15, -1, 6); + BBB_PINS.emplace_back("P2-34", 115).setPRU(0, 5, 6, 5); + BBB_PINS.emplace_back("P2-35", 86).setPRU(1, 8, 6, 5); + } else { + BBB_PINS.emplace_back("P8-03", 38); + BBB_PINS.emplace_back("P8-04", 39); + BBB_PINS.emplace_back("P8-05", 34); + BBB_PINS.emplace_back("P8-06", 35); + BBB_PINS.emplace_back("P8-07", 66); + BBB_PINS.emplace_back("P8-08", 67); + BBB_PINS.emplace_back("P8-09", 69); + BBB_PINS.emplace_back("P8-10", 68); + BBB_PINS.emplace_back("P8-11", 45).setPRU(0, 15, -1, 6); + BBB_PINS.emplace_back("P8-12", 44).setPRU(0, 14, -1, 6); + BBB_PINS.emplace_back("P8-13", 23).setPwm(2, 1, 4); + BBB_PINS.emplace_back("P8-14", 26); + BBB_PINS.emplace_back("P8-15", 47); + BBB_PINS.emplace_back("P8-16", 46); + BBB_PINS.emplace_back("P8-17", 27); + BBB_PINS.emplace_back("P8-18", 65); + BBB_PINS.emplace_back("P8-19", 22).setPwm(2, 0, 4); + BBB_PINS.emplace_back("P8-20", 63).setPRU(1, 13, 6, 5); + BBB_PINS.emplace_back("P8-21", 62).setPRU(1, 12, 6, 5); + BBB_PINS.emplace_back("P8-22", 37); + BBB_PINS.emplace_back("P8-23", 36); + BBB_PINS.emplace_back("P8-24", 33); + BBB_PINS.emplace_back("P8-25", 32); + BBB_PINS.emplace_back("P8-26", 61); + BBB_PINS.emplace_back("P8-27", 86).setPRU(1, 8, 6, 5); + BBB_PINS.emplace_back("P8-28", 88).setPRU(1, 10, 6, 5); + BBB_PINS.emplace_back("P8-29", 87).setPRU(1, 9, 6, 5); + BBB_PINS.emplace_back("P8-30", 89).setPRU(1, 11, 6, 5); + BBB_PINS.emplace_back("P8-31", 10); + BBB_PINS.emplace_back("P8-32", 11); + BBB_PINS.emplace_back("P8-33", 9); + BBB_PINS.emplace_back("P8-34", 81).setPwm(1, 1, 2); + BBB_PINS.emplace_back("P8-35", 8); + BBB_PINS.emplace_back("P8-36", 80).setPwm(1, 0, 2); + BBB_PINS.emplace_back("P8-37", 78).setUART("ttyS5-tx", 4); + BBB_PINS.emplace_back("P8-38", 79).setUART("ttyS5-rx", 4); + BBB_PINS.emplace_back("P8-39", 76).setPRU(1, 6, 6, 5); + BBB_PINS.emplace_back("P8-40", 77).setPRU(1, 7, 6, 5); + BBB_PINS.emplace_back("P8-41", 74).setPRU(1, 4, 6, 5); + BBB_PINS.emplace_back("P8-42", 75).setPRU(1, 5, 6, 5); + BBB_PINS.emplace_back("P8-43", 72).setPRU(1, 2, 6, 5); + BBB_PINS.emplace_back("P8-44", 73).setPRU(1, 3, 6, 5); + BBB_PINS.emplace_back("P8-45", 70).setPRU(1, 0, 6, 5).setPwm(2, 0, 3); + BBB_PINS.emplace_back("P8-46", 71).setPRU(1, 1, 6, 5).setPwm(2, 1, 3); + BBB_PINS.emplace_back("P9-11", 30).setUART("ttyS4-rx", 6); + BBB_PINS.emplace_back("P9-12", 60); + BBB_PINS.emplace_back("P9-13", 31).setUART("ttyS4-tx", 6); + BBB_PINS.emplace_back("P9-14", 50).setPwm(1, 0, 6); + BBB_PINS.emplace_back("P9-15", 48); + BBB_PINS.emplace_back("P9-16", 51).setPwm(1, 1, 6); + BBB_PINS.emplace_back("P9-17", 5).setI2C(1, 2); + BBB_PINS.emplace_back("P9-18", 4).setI2C(1, 2); + BBB_PINS.emplace_back("P9-19", 13).setI2C(2, 3); + BBB_PINS.emplace_back("P9-20", 12).setI2C(2, 3); + BBB_PINS.emplace_back("P9-21", 3).setPwm(0, 1, 3).setUART("ttyS2-tx", 1); + BBB_PINS.emplace_back("P9-22", 2).setPwm(0, 0, 3).setUART("ttyS2-rx", 1); + BBB_PINS.emplace_back("P9-23", 49); + BBB_PINS.emplace_back("P9-24", 15).setUART("ttyS1-tx", 0); + BBB_PINS.emplace_back("P9-25", 117).setPRU(0, 7, 6, 5); + BBB_PINS.emplace_back("P9-26", 14).setUART("ttyS1-rx", 0); + BBB_PINS.emplace_back("P9-27", 115).setPRU(0, 5, 6, 5); + BBB_PINS.emplace_back("P9-28", 113).setPRU(0, 3, 6, 5); + BBB_PINS.emplace_back("P9-29", 111).setPRU(0, 1, 6, 5).setPwm(0, 1, 1); + BBB_PINS.emplace_back("P9-30", 112).setPRU(0, 2, 6, 5); + BBB_PINS.emplace_back("P9-31", 110).setPRU(0, 0, 6, 5).setPwm(0, 0, 1); + BBB_PINS.emplace_back("P9-41", 20); + BBB_PINS.emplace_back("P9-91", 116).setPRU(0, 6, 6, 5); + BBB_PINS.emplace_back("P9-42", 7).setUART("ttyS3-tx", 1); + BBB_PINS.emplace_back("P9-92", 114).setPRU(0, 4, 6, 5); + } +#endif +#ifdef PLATFORM_BB64 if (getBeagleBoneType() == PocketBeagle) { - BBB_PINS.emplace_back("P1-02", 87, 0x8E4).setPRU(1, 9, 6, 5); - BBB_PINS.emplace_back("P1-04", 89, 0x8EC).setPRU(1, 11, 6, 5); - BBB_PINS.emplace_back("P1-06", 5, 0x95C).setI2C(1, 2); - BBB_PINS.emplace_back("P1-08", 2, 0x950).setPwm(0, 0, 3).setUART("ttyS2-rx", 1); - BBB_PINS.emplace_back("P1-10", 3, 0x954).setPwm(0, 1, 3).setUART("ttyS2-tx", 1); - BBB_PINS.emplace_back("P1-12", 4, 0x958).setI2C(1, 2); - BBB_PINS.emplace_back("P1-20", 20, 0x9B4); - BBB_PINS.emplace_back("P1-26", 12, 0x978).setI2C(2, 3); - BBB_PINS.emplace_back("P1-28", 13, 0x97C).setI2C(2, 3); - BBB_PINS.emplace_back("P1-29", 117, 0x9AC).setPRU(0, 7, 6, 5); - BBB_PINS.emplace_back("P1-30", 43, 0x974).setPRU(1, 15, 6, 5).setUART("ttyS0-tx", 0); - BBB_PINS.emplace_back("P1-31", 114, 0x9A0).setPRU(0, 4, 6, 5); - BBB_PINS.emplace_back("P1-32", 42, 0x970).setPRU(1, 14, 6, 5).setUART("ttyS0-rx", 0); - BBB_PINS.emplace_back("P1-33", 111, 0x994).setPRU(0, 1, 6, 5).setPwm(0, 1, 1); - BBB_PINS.emplace_back("P1-34", 26, 0x828); - BBB_PINS.emplace_back("P1-35", 88, 0x8E8).setPRU(1, 10, 6, 5); - BBB_PINS.emplace_back("P1-36", 110, 0x990).setPRU(0, 0, 6, 5).setPwm(0, 0, 1); - BBB_PINS.emplace_back("P2-01", 50, 0x848).setPwm(1, 0, 6); - BBB_PINS.emplace_back("P2-02", 59, 0x86C); - BBB_PINS.emplace_back("P2-03", 23, 0x824).setPwm(2, 1, 4); - BBB_PINS.emplace_back("P2-04", 58, 0x868); - BBB_PINS.emplace_back("P2-05", 30, 0x870).setUART("ttyS4-rx", 6); - BBB_PINS.emplace_back("P2-06", 57, 0x864); - BBB_PINS.emplace_back("P2-07", 31, 0x874).setUART("ttyS4-tx", 6); - BBB_PINS.emplace_back("P2-08", 60, 0x878); - BBB_PINS.emplace_back("P2-09", 15, 0x984).setUART("ttyS1-tx", 0); - BBB_PINS.emplace_back("P2-10", 52, 0x850); - BBB_PINS.emplace_back("P2-11", 14, 0x980).setUART("ttyS1-rx", 0); - BBB_PINS.emplace_back("P2-17", 65, 0x88C); - BBB_PINS.emplace_back("P2-18", 47, 0x83C); - BBB_PINS.emplace_back("P2-19", 27, 0x82C); - BBB_PINS.emplace_back("P2-20", 64, 0x888); - BBB_PINS.emplace_back("P2-22", 46, 0x838); - BBB_PINS.emplace_back("P2-24", 44, 0x830).setPRU(0, 14, -1, 6); - BBB_PINS.emplace_back("P2-25", 41, 0x96C).setUART("ttyS4-tx", 1); - BBB_PINS.emplace_back("P2-27", 40, 0x968).setUART("ttyS4-rx", 1); - BBB_PINS.emplace_back("P2-28", 116, 0x9A8).setPRU(0, 6, 6, 5); - BBB_PINS.emplace_back("P2-29", 7, 0x964).setUART("ttyS3-tx", 1); - BBB_PINS.emplace_back("P2-30", 113, 0x99C).setPRU(0, 3, 6, 5); - BBB_PINS.emplace_back("P2-31", 19, 0x9B0); - BBB_PINS.emplace_back("P2-32", 112, 0x998).setPRU(0, 2, 6, 5); - BBB_PINS.emplace_back("P2-33", 45, 0x834).setPRU(0, 15, -1, 6); - BBB_PINS.emplace_back("P2-34", 115, 0x9A4).setPRU(0, 5, 6, 5); - BBB_PINS.emplace_back("P2-35", 86, 0x8E0).setPRU(1, 8, 6, 5); + BBB_PINS.emplace_back("P1-02", 2, 87); + BBB_PINS.emplace_back("P1-02b", 3, 10); + BBB_PINS.emplace_back("P1-04", 2, 88); + BBB_PINS.emplace_back("P1-04b", 3, 12); + BBB_PINS.emplace_back("P1-06", 2, 78); + BBB_PINS.emplace_back("P1-06b", 3, 13); + BBB_PINS.emplace_back("P1-08", 3, 14); + BBB_PINS.emplace_back("P1-10", 3, 7); + BBB_PINS.emplace_back("P1-10b", 3, 30); + BBB_PINS.emplace_back("P1-12", 2, 77); + BBB_PINS.emplace_back("P1-12b", 3, 8); + BBB_PINS.emplace_back("P1-13", 2, 36); + BBB_PINS.emplace_back("P1-19", 3, 1); + BBB_PINS.emplace_back("P1-20", 2, 50); + BBB_PINS.emplace_back("P1-21", 3, 6); + BBB_PINS.emplace_back("P1-23", 3, 5); + BBB_PINS.emplace_back("P1-25", 3, 4); + BBB_PINS.emplace_back("P1-26", 2, 44); + BBB_PINS.emplace_back("P1-26b", 1, 13); + BBB_PINS.emplace_back("P1-27", 3, 3); + BBB_PINS.emplace_back("P1-28", 2, 43); + BBB_PINS.emplace_back("P1-28b", 1, 14); + BBB_PINS.emplace_back("P1-29", 2, 62); + BBB_PINS.emplace_back("P1-30", 3, 21); + BBB_PINS.emplace_back("P1-31", 2, 49); + BBB_PINS.emplace_back("P1-32", 3, 20); + BBB_PINS.emplace_back("P1-33", 2, 56); + BBB_PINS.emplace_back("P1-33b", 3, 29); + BBB_PINS.emplace_back("P1-34", 3, 2); + BBB_PINS.emplace_back("P1-35", 2, 88); + BBB_PINS.emplace_back("P1-36", 2, 55); + BBB_PINS.emplace_back("P1-36b", 3, 28); + + BBB_PINS.emplace_back("P2-01", 2, 86); + BBB_PINS.emplace_back("P2-01b", 3, 11); + BBB_PINS.emplace_back("P2-02", 2, 45); + BBB_PINS.emplace_back("P2-03", 2, 85); + BBB_PINS.emplace_back("P2-03b", 3, 9); + BBB_PINS.emplace_back("P2-04", 2, 46); + BBB_PINS.emplace_back("P2-05", 3, 24); + BBB_PINS.emplace_back("P2-05b", 1, 5); + BBB_PINS.emplace_back("P2-06", 2, 47); + BBB_PINS.emplace_back("P2-07", 3, 25); + BBB_PINS.emplace_back("P2-07b", 1, 6); + BBB_PINS.emplace_back("P2-08", 2, 48); + BBB_PINS.emplace_back("P2-09", 3, 22); + BBB_PINS.emplace_back("P2-09b", 1, 16); + BBB_PINS.emplace_back("P2-10", 2, 91); + BBB_PINS.emplace_back("P2-11", 3, 23); + BBB_PINS.emplace_back("P2-11b", 1, 15); + BBB_PINS.emplace_back("P2-17", 2, 64); + BBB_PINS.emplace_back("P2-18", 2, 53); + BBB_PINS.emplace_back("P2-19", 3, 0); + BBB_PINS.emplace_back("P2-20", 2, 49); + BBB_PINS.emplace_back("P2-22", 2, 63); + BBB_PINS.emplace_back("P2-24", 2, 51); + BBB_PINS.emplace_back("P2-25", 3, 19); + BBB_PINS.emplace_back("P2-27", 3, 18); + BBB_PINS.emplace_back("P2-28", 2, 61); + BBB_PINS.emplace_back("P2-29", 2, 40); + BBB_PINS.emplace_back("P2-29b", 3, 17); + BBB_PINS.emplace_back("P2-30", 2, 58); + BBB_PINS.emplace_back("P2-31", 2, 90); + BBB_PINS.emplace_back("P2-31b", 3, 15); + BBB_PINS.emplace_back("P2-32", 2, 57); + BBB_PINS.emplace_back("P2-33", 2, 52); + BBB_PINS.emplace_back("P2-34", 2, 60); + BBB_PINS.emplace_back("P2-35", 2, 54); + BBB_PINS.emplace_back("P2-36", 3, 16); } else { - BBB_PINS.emplace_back("P8-03", 38, 0x818); - BBB_PINS.emplace_back("P8-04", 39, 0x81C); - BBB_PINS.emplace_back("P8-05", 34, 0x808); - BBB_PINS.emplace_back("P8-06", 35, 0x80C); - BBB_PINS.emplace_back("P8-07", 66, 0x890); - BBB_PINS.emplace_back("P8-08", 67, 0x894); - BBB_PINS.emplace_back("P8-09", 69, 0x89C); - BBB_PINS.emplace_back("P8-10", 68, 0x898); - BBB_PINS.emplace_back("P8-11", 45, 0x834).setPRU(0, 15, -1, 6); - BBB_PINS.emplace_back("P8-12", 44, 0x830).setPRU(0, 14, -1, 6); - BBB_PINS.emplace_back("P8-13", 23, 0x824).setPwm(2, 1, 4); - BBB_PINS.emplace_back("P8-14", 26, 0x828); - BBB_PINS.emplace_back("P8-15", 47, 0x83C); - BBB_PINS.emplace_back("P8-16", 46, 0x838); - BBB_PINS.emplace_back("P8-17", 27, 0x82C); - BBB_PINS.emplace_back("P8-18", 65, 0x88C); - BBB_PINS.emplace_back("P8-19", 22, 0x820).setPwm(2, 0, 4); - BBB_PINS.emplace_back("P8-20", 63, 0x884).setPRU(1, 13, 6, 5); - BBB_PINS.emplace_back("P8-21", 62, 0x880).setPRU(1, 12, 6, 5); - BBB_PINS.emplace_back("P8-22", 37, 0x814); - BBB_PINS.emplace_back("P8-23", 36, 0x810); - BBB_PINS.emplace_back("P8-24", 33, 0x804); - BBB_PINS.emplace_back("P8-25", 32, 0x800); - BBB_PINS.emplace_back("P8-26", 61, 0x87C); - BBB_PINS.emplace_back("P8-27", 86, 0x8E0).setPRU(1, 8, 6, 5); - BBB_PINS.emplace_back("P8-28", 88, 0x8E8).setPRU(1, 10, 6, 5); - BBB_PINS.emplace_back("P8-29", 87, 0x8E4).setPRU(1, 9, 6, 5); - BBB_PINS.emplace_back("P8-30", 89, 0x8EC).setPRU(1, 11, 6, 5); - BBB_PINS.emplace_back("P8-31", 10, 0x8D8); - BBB_PINS.emplace_back("P8-32", 11, 0x8DC); - BBB_PINS.emplace_back("P8-33", 9, 0x8D4); - BBB_PINS.emplace_back("P8-34", 81, 0x8CC).setPwm(1, 1, 2); - BBB_PINS.emplace_back("P8-35", 8, 0x8D0); - BBB_PINS.emplace_back("P8-36", 80, 0x8C8).setPwm(1, 0, 2); - BBB_PINS.emplace_back("P8-37", 78, 0x8C0).setUART("ttyS5-tx", 4); - BBB_PINS.emplace_back("P8-38", 79, 0x8C4).setUART("ttyS5-rx", 4); - BBB_PINS.emplace_back("P8-39", 76, 0x8B8).setPRU(1, 6, 6, 5); - BBB_PINS.emplace_back("P8-40", 77, 0x8BC).setPRU(1, 7, 6, 5); - BBB_PINS.emplace_back("P8-41", 74, 0x8B0).setPRU(1, 4, 6, 5); - BBB_PINS.emplace_back("P8-42", 75, 0x8B4).setPRU(1, 5, 6, 5); - BBB_PINS.emplace_back("P8-43", 72, 0x8A8).setPRU(1, 2, 6, 5); - BBB_PINS.emplace_back("P8-44", 73, 0x8AC).setPRU(1, 3, 6, 5); - BBB_PINS.emplace_back("P8-45", 70, 0x8A0).setPRU(1, 0, 6, 5).setPwm(2, 0, 3); - BBB_PINS.emplace_back("P8-46", 71, 0x8A4).setPRU(1, 1, 6, 5).setPwm(2, 1, 3); - BBB_PINS.emplace_back("P9-11", 30, 0x870).setUART("ttyS4-rx", 6); - BBB_PINS.emplace_back("P9-12", 60, 0x878); - BBB_PINS.emplace_back("P9-13", 31, 0x874).setUART("ttyS4-tx", 6); - BBB_PINS.emplace_back("P9-14", 50, 0x848).setPwm(1, 0, 6); - BBB_PINS.emplace_back("P9-15", 48, 0x840); - BBB_PINS.emplace_back("P9-16", 51, 0x84C).setPwm(1, 1, 6); - BBB_PINS.emplace_back("P9-17", 5, 0x95C).setI2C(1, 2); - BBB_PINS.emplace_back("P9-18", 4, 0x958).setI2C(1, 2); - BBB_PINS.emplace_back("P9-19", 13, 0x97C).setI2C(2, 3); - BBB_PINS.emplace_back("P9-20", 12, 0x978).setI2C(2, 3); - BBB_PINS.emplace_back("P9-21", 3, 0x954).setPwm(0, 1, 3).setUART("ttyS2-tx", 1); - BBB_PINS.emplace_back("P9-22", 2, 0x950).setPwm(0, 0, 3).setUART("ttyS2-rx", 1); - BBB_PINS.emplace_back("P9-23", 49, 0x844); - BBB_PINS.emplace_back("P9-24", 15, 0x984).setUART("ttyS1-tx", 0); - BBB_PINS.emplace_back("P9-25", 117, 0x9AC).setPRU(0, 7, 6, 5); - BBB_PINS.emplace_back("P9-26", 14, 0x980).setUART("ttyS1-rx", 0); - BBB_PINS.emplace_back("P9-27", 115, 0x9A4).setPRU(0, 5, 6, 5); - BBB_PINS.emplace_back("P9-28", 113, 0x99C).setPRU(0, 3, 6, 5); - BBB_PINS.emplace_back("P9-29", 111, 0x994).setPRU(0, 1, 6, 5).setPwm(0, 1, 1); - BBB_PINS.emplace_back("P9-30", 112, 0x998).setPRU(0, 2, 6, 5); - BBB_PINS.emplace_back("P9-31", 110, 0x990).setPRU(0, 0, 6, 5).setPwm(0, 0, 1); - BBB_PINS.emplace_back("P9-41", 20, 0x9B4); - BBB_PINS.emplace_back("P9-91", 116, 0x9A8).setPRU(0, 6, 6, 5); - BBB_PINS.emplace_back("P9-42", 7, 0x964).setUART("ttyS3-tx", 1); - BBB_PINS.emplace_back("P9-92", 114, 0x9A0).setPRU(0, 4, 6, 5); + printf("Unknown type: %d\n", getBeagleBoneType()); } +#endif } } diff --git a/src/util/BBBUtils.h b/src/util/BBBUtils.h index 11f16f055..31f2d86c8 100644 --- a/src/util/BBBUtils.h +++ b/src/util/BBBUtils.h @@ -30,7 +30,8 @@ BeagleBoneType getBeagleBoneType(); class BBBPinCapabilities : public GPIODCapabilities { public: - BBBPinCapabilities(const std::string& n, uint32_t k, uint32_t offset); + BBBPinCapabilities(const std::string& n, uint32_t k); + BBBPinCapabilities(const std::string& n, uint32_t g, uint32_t offset); virtual int configPin(const std::string& mode = "gpio", bool directionOut = true) const override; diff --git a/www/co-pixelStrings.php b/www/co-pixelStrings.php index f13cb016c..f9340e906 100644 --- a/www/co-pixelStrings.php +++ b/www/co-pixelStrings.php @@ -2090,7 +2090,7 @@ function setupPixelLimits() { } } - + var PIXEL_STRING_FILE_NAME = "co-bbbStrings"; var PIXEL_STRING_FILE_NAME = "co-pixelStrings"; @@ -2639,4 +2639,4 @@ function pinTableHeader() { - + \ No newline at end of file