Current location - Quotes Website - Collection of slogans - When debugging serial port under ubuntu, nosuchfileordir appears.
When debugging serial port under ubuntu, nosuchfileordir appears.
1, confirm whether the serial port device file name is correct. Under Ubuntu, the file names of serial devices are usually /dev/ttyub0 or /dev/ttyus0, etc. You can use the ls/dev/ command to view a list of serial device files in the current system.

2. Confirm whether the serial device file exists. If the device file does not exist, you can create a device file by the following command: sudo mknod /dev/ttyub 0c 1880, where/dev/ttyub0 is the device file name and188 and 0 are the primary and secondary device numbers of the device, which can be modified according to the actual situation. If it is a USB-to-serial device, the main device number is usually 188, and the auxiliary device number is 0.

3. Confirm whether the user has access to serial device files. You can add the current user to the dial-out user group to access the serial device: sudousermod-a-Gdialoutusername, where username is the user name of the current user.