# Problems with CANbus

**URL:** <https://forum.opencyphal.org/t/problems-with-canbus/1582>\
**Category:** LibCyphal\
**Created:** [January 26, 2022, 7:37pm UTC](https://forum.opencyphal.org/t/problems-with-canbus/1582 "2022-01-26T19:37:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrei\_Shumski](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/andrei_shumski/32/1037_2.png) [@Andrei\_Shumski](https://forum.opencyphal.org/u/Andrei_Shumski)\
**Post date:** [January 26, 2022, 7:37pm UTC](https://forum.opencyphal.org/t/problems-with-canbus/1582/1 "2022-01-26T19:37:10Z")

</div>

I have some problems with CANbus. I try to add basic CANbus to project Plane  
I have two functions. First one init for CAN

```auto
uint8_t _driver_index = 0;
uint8_t _interface = 0;
uavcan::ICanDriver* _can_driver;
AP_HAL::CANManager* can_mgr = new ChibiOS::CANManager;

void Plane::init(void)
{
const_cast <AP_HAL::HAL&> (hal).can_mgr[_driver_index] = can_mgr;
can_mgr->begin(1000000, _interface);
can_mgr->initialized(true);
}

void Plane::CANTransmit()
{
uavcan::CanFrame frame;
uavcan::MonotonicTime timeout = uavcan::MonotonicTime::fromUSec(AP_HAL::millis() + 500);
int16_t res2 = _can_driver->getIface(_interface)->send(frame, timeout, 0);
if (res2 == 1) {
return;
}
}

```

code build - OK, but autopilot reboots every 2-3 seconds.  
Also i dont see anything in the terminal (use PCAN-USB Adapter and PCAN-View)  
the main task, I want to transmit messages by CANbus  
One more question, While using PCAN-View I can see some messages from CAN, what this messages mean?

---

<div class="post-metadata">

**Author:** ![pavel.kirienko](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/pavel.kirienko/32/9_2.png) [@pavel.kirienko](https://forum.opencyphal.org/u/pavel.kirienko)\
**Post date:** [January 28, 2022, 4:49am UTC](https://forum.opencyphal.org/t/problems-with-canbus/1582/2 "2022-01-28T04:49:58Z")

</div>

This is not an ArduPilot support forum. Head this way please: [https://discuss.ardupilot.org/](https://discuss.ardupilot.org/)
