Arduino : підключаєм Arduino до FreeBSD по USB

Якось мені захотілось отримувати більш детальну інфу з ардуіно, тим більш, на ній ще залишилось місце щоб підключити інші датчики. До цього моменту, вона займались лише керуванням освітлення в акваріумі, та включенням фільтру та подачі повітря. Недалеко від акваріума стоїть ноутбук з FreeBSD. Підключив Arduino до USB порта. Попереше знадобиться встановити з ports наступне - comms/uarduno.

Ідем до того каталогу
# cd /usr/ports/comms/uarduno


АЛЕ! Не все так просто. Потрібно внести Вашу Arduino до /usr/ports/comms/uarduno/files/ids.txt
В мене цей файл мав ось такий вигляд:


// Arduino UNO USB Serial Port Kernel Driver for FreeBSD
//
// This is a user-modifiable file that can be used to add extra
// USB Vendor ID / Product ID combinations to the list of existing
// combinations that the driver recognizes as an Arduino Uno.
//
// If you modify your Arduino Uno (or obtain a similar unit with a different
// Vendor/Product combination) you can simply modify this file to include
// the new Vendor/Product information.
//
// Place your NEW Vendor ID / Product ID combinations below in the form of
// a C-language structure initializer entry, as follows
//
//     { 0xaaaa, 0xbbbb },
//
// Where '0xaaaa' is the vendor ID, and '0xbbbb' is the product ID that you
// want the driver to recognize as an Arduino UNO.  It must end with a ','
//
// The default values for Arduino UNO and MEGA are included as a reference.
// These are provided 'as-is' though testing suggests they are correct.
//
// When new Arduino products are released, you can add the new information to
// this file.  Please let me know so I can update it, too (thanks).  Send
// new submissions to 'bobf@mrp3.com', with an appropriate subject line and
// description of the entry.  Please test it first, thanks.
//
// If you change this file yourself, you will need to update it eachdd
// time you obtain a fresh copy of the ports tree.
//
//

    { 0x2341, 0x0001 },  // Arduino UNO, vendor 2341H, product 0001H
    { 0x2341, 0x0042 },  // Arduino MEGA (rev 3), vendor 2341H, product 0042H
    { 0x2341, 0x0043 },  // Arduino UNO (rev 3), vendor 2341H, product 0043H
    { 0x2341, 0x0010 },  // Arduino MEGA 2560 R3, vendor 2341H, product 0010H
    { 0x2341, 0x8037 },  // Arduino Micro

// place your entries below this line



// end of file



І як там пишуть - якщо ви маэте якусь іншу ардуіинку тоді Вам потрібно додати Vendor ID та Product ID.
Як дізнатись ці ID-шки з вашої USB ардінки читайте тут.

Я помістив настйпні данні після  // place your entries below this line
// place your entries below this line
{ 0x0403, 0x6001 },  // My Arduino UNO


Зібравши пакет:
make && make install


Залишилось виконати загрузку скомпільованого модуля
kldload uarduno.ko


Після цього в меня з'явився COM порт з яким вже можна робити те, що Вам потрібно.


Якщо Ви хочете щоб модуль загружався автоматично при старті FreeBSD, помістіть наступну строчку до /boo/loader.conf
uarduno_load="YES"



Вы только посетили наш сайт, КОММЕНТИРОВАНИЕ будет доступно через несколько минут.
возможно у Вас отключен javascript, если включен - просто обновите страницу