Normally you press buttons to enter listening or DFU mode on the Photon or Electron. The commands other then the last two Wi-Fi related commands are also available on the Electron. You can also get into listening mode by holding down SETUP for about 3 seconds until the status LED blinks blue. Listening mode is the default when you plug in a Photon the first time. m - Print MAC Address for the Wi-Fi adapter.L - Safe listen mode (does not run user code concurrently with listening mode).i - Prints the device ID (24 character hexadecimal string).Each of these commands only requires that you type the command letter (case-sensitive): If the Photon is in listening mode (blinking dark blue), configuration can also be done using the USB Serial port. Tap yes and you should see a screen in the picture above. Open the serial monitor app and it should ask if you want to connect to the device. Install the "Android USB Serial Monitor Lite" application from the Google Play store.Ĭonnect the device to your phone using a USB cable and a USB OTG adapter. If your Android phone supports USB OTG ("on the go") and you have an OTG adapter cable, you may be able to use it for debugging serial! One caveat is that your phone probably won't power up a Photon, so this will probably only work if you have an external power source, like an Electron or Photon with a battery. You can send data via serial with the Arduino IDE as well, but you need to enter text to send in the box at the top of the window and press Return or click Send. Then select Serial Monitor from the Tools menu. Select the port from the Port hierarchical menu in the Tools menu. To close (kill) a screen session, press Ctrl-A then press k. Then issue the command: screen /dev/ttyACM0 It should return something like /dev/ttyACM0. ![]() Linux - using screenįind the serial port that is being used using the Terminal program command line: ls /dev/ttyACM* Screen allows you you both send characters to the Photon or Electron as well as receive them from the USB serial device. Then issue the command: screen /dev/cu.usbmodemFD1161 It should return something like /dev/cu.usbmodemFD1161. Mac - using screenįind the serial port that is being used using the Terminal program command line: ls /dev/cu.usb* This is the configuration screen for PuTTY:Ĭlick Serial (1) then enter the COM port number (2) then click Open (3). It's hard to say what COM port your Photon or Electron will use, but if you open the Windows Device Manager and expand Ports (COM & LPT) it should show the device. Windows - using PuTTY or CoolTermįor Windows, you can also use a program like PuTTY or CoolTerm. In Particle Workbench (VS Code), open the command palette (Command-Shift-P on the Mac, Ctrl-Shift-P on Windows and Linux) and select Particle: Serial Monitor. Opening serial monitor for com port: "/dev/cu.usbmodemFD1161" Still, it's quick and easy, and very handy. Note that the CLI only reads serial messages, it is strictly a serial monitor, and you can't type things to the Photon/Electron. Particle CLIĪ common way to view debug serial messages is the Particle CLI. The Serial.printlnf prints a formatted string to the debugging USB serial. In fact, youĬan just omit the baud rate entirely and use Serial.begin(). Sometimes you'll see Serial.begin(115200) but it really runs at the same fast speed regardless. When you're using the USB serial, the value doesn't actually matter. The Serial.begin(9600) call initializes the serial port. ![]() ![]() Serial.printlnf("testing %d", ++counter) Often this is used for debugging messages. The USB serial provides a way for the Photon/Electron to send data to the computer across the USB connection. Learn about serial ports, UARTs, USB serial ports, RS-232, and more! USB serial
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |