I have an Arduino Leonardo connected to my OpenWrt-based router via USB. On the OpenWrt router, I have installed the Arduino-related components of Linino as documented on Install Arduino Yun (Linino) software on OpenWrt on 3rd-party devices. TODO: Fully automate install and/or use Linino rootfs image and/or build own firmware using OpenWrt Image Generator. CAVEATS: I have not yet found out how to make the Bridge use Serial (USB) instead of Serial1 (HardwareSerial) for the Leonardo. I have asked a question about this on http://forum.arduino.cc/index.php?topic=229643.0 · GitHub - this setup works for other Arduinos but not for the Leonardo so far, since the Bridge library is using Serial1 rather than Serial (which I would want) on the Leonardo.
I would like to use the Arduino Yun's Bridge library and run it on an Arduino Leonardo, but rather than using the hardware serial RX/TX pins I would like to communicate over the USB CDC serial connection.
At the end of Bridge.cpp I find:
// Bridge instance
#ifdef __AVR_ATmega32U4__
// Leonardo variants (where HardwareSerial is Serial1)
SerialBridgeClass Bridge(Serial1);
#else
SerialBridgeClass Bridge(Serial);
#endif
I change this to:
// Bridge instance
// Port which normally prints to the Arduino Serial Monitor according to pins_arduino.h
SerialBridgeClass Bridge(SERIAL_PORT_MONITOR);
But now I get:
libraries/Bridge/src/Bridge.cpp:244: error: no matching function for call to 'SerialBridgeClass::SerialBridgeClass(Serial_&)'
libraries/Bridge/src/Bridge.h:94: note: candidates are: SerialBridgeClass::SerialBridgeClass(HardwareSerial&)
libraries/Bridge/src/Bridge.h:92: note: SerialBridgeClass::SerialBridgeClass(const SerialBridgeClass&)
In Bridge.h I find:
// This subclass uses a serial port Stream
class SerialBridgeClass : public BridgeClass {
public:
SerialBridgeClass(HardwareSerial &_serial)
: BridgeClass(_serial), serial(_serial) {
// Empty
}
void begin(unsigned long baudrate = 115200) {
serial.begin(baudrate);
BridgeClass::begin();
}
private:
HardwareSerial &serial;
};
extern SerialBridgeClass Bridge;
Can you help me to make the Bridge work over (USB CDC) Serial rather than Serial1?