<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Error when opening CAN handle with library</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/cdc7ec1c7c/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Runtime/thread/cdc7ec1c7c/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Runtime/thread/cdc7ec1c7c/</id><updated>2020-02-27T16:31:14.891000Z</updated><subtitle>Recent posts to Error when opening CAN handle with library</subtitle><entry><title>Error when opening CAN handle with library</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/cdc7ec1c7c/?limit=25#be99" rel="alternate"/><published>2020-02-27T16:31:14.891000Z</published><updated>2020-02-27T16:31:14.891000Z</updated><author><name>dvdende</name><uri>https://forge.codesys.com/u/dvdende/</uri></author><id>https://forge.codesys.com70e08eab2b899f85c5441c7269c151c1f46c6d2a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Today I installed the Codesys package V3.5.9.40 en now the CAN bus isfunctioning when 2 CAN overlays are loaded.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Error when opening CAN handle with library</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/cdc7ec1c7c/?limit=25#83f9" rel="alternate"/><published>2020-02-27T16:31:14.033000Z</published><updated>2020-02-27T16:31:14.033000Z</updated><author><name>dvdende</name><uri>https://forge.codesys.com/u/dvdende/</uri></author><id>https://forge.codesys.come56bac155254447c0f82843172217d51173a7b22</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I tried several settings in the config.txt and interfaces files but cannot find a solution. The strange phenomena is that ifconfig can0 shows that messages are coming in and that Codesys is not seeing any messages with 2 CAN overlays loaded. With 1 CAN overlay loaded everything is fine.&lt;/p&gt;
&lt;p&gt;It looks that the problem is inside the Codesys run-time.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Error when opening CAN handle with library</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/cdc7ec1c7c/?limit=25#30b5" rel="alternate"/><published>2020-02-27T16:31:13.186000Z</published><updated>2020-02-27T16:31:13.186000Z</updated><author><name>menno</name><uri>https://forge.codesys.com/u/menno/</uri></author><id>https://forge.codesys.comd1f5198bd4045da96db38d9f757d56a9171682ba</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;In my setup I have two Raspberry Pi 3, both with CanberryDual. I could not get CANopen working from CODESYS, but after trying your tip of only adding the first CAN overlay it now works! If anyone has some clue or directions how to get it working with both CAN ports, it would be very welcome!&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Error when opening CAN handle with library</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/cdc7ec1c7c/?limit=25#53b9" rel="alternate"/><published>2020-02-27T16:31:10.750000Z</published><updated>2020-02-27T16:31:10.750000Z</updated><author><name>dvdende</name><uri>https://forge.codesys.com/u/dvdende/</uri></author><id>https://forge.codesys.com5acc95dc9466b070b1e60987f88ea9ae865661b9</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks for the tip. We already tried to add that setting to the config.txt maar it does not help anything. We get messages in Linux when we look with ifconfig. We only do NOT get the CAN messages in Codesys. When we use 1 can layer it is functioning. It does not function with two layers loaded.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Error when opening CAN handle with library</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/cdc7ec1c7c/?limit=25#a5fe" rel="alternate"/><published>2020-02-27T16:31:09.892000Z</published><updated>2020-02-27T16:31:09.892000Z</updated><author><name>olteanu-eu</name><uri>https://forge.codesys.com/u/olteanu-eu/</uri></author><id>https://forge.codesys.comf9f9918b1d17e6917f264b6612a74f8ef880d153</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;in config .txt put&lt;br/&gt;
dtparam=spi=on&lt;br/&gt;
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=23 &lt;br/&gt;
dtoverlay=mcp2515-can1,oscillator=16000000,interrupt=24&lt;/p&gt;
&lt;p&gt;i must to verified  the oscillator fervency &lt;br/&gt;
this setting is for last Linux kernel&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Error when opening CAN handle with library</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/cdc7ec1c7c/?limit=25#222d" rel="alternate"/><published>2020-02-27T16:31:07.461000Z</published><updated>2020-02-27T16:31:07.461000Z</updated><author><name>dvdende</name><uri>https://forge.codesys.com/u/dvdende/</uri></author><id>https://forge.codesys.comf34bb81aae93cab540c45f8c70319095434bda2d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I found the reason of the problem. When I load both can0 and can1 overlays in de config.txt than it will not function anymore. With only the can0 overlay loaded everything works fine.&lt;/p&gt;
&lt;p&gt;I have two mcp2515 chips added to the system, on interrupt 23 and 24. With the Pi B+ I had no problem. Now I have the Pi 3 and it does not work anymore for 2 can busses.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Error when opening CAN handle with library</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/cdc7ec1c7c/?limit=25#e5ab" rel="alternate"/><published>2020-02-27T16:31:06.606000Z</published><updated>2020-02-27T16:31:06.606000Z</updated><author><name>olteanu-eu</name><uri>https://forge.codesys.com/u/olteanu-eu/</uri></author><id>https://forge.codesys.com7131981b2add58ace02e103cad33df7c6564fd3c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;h1 id="binsh"&gt;!/bin/sh&lt;/h1&gt;
&lt;p&gt;BITRATE=&lt;code&gt;expr $2 \\* 1000&lt;/code&gt;&lt;br/&gt;
ifconfig $1 down&lt;br/&gt;
echo ip link set $1 type can bitrate $BITRATE&lt;br/&gt;
ip link set $1 type can bitrate $BITRATE&lt;br/&gt;
ifconfig $1 up&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Error when opening CAN handle with library</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/cdc7ec1c7c/?limit=25#9602" rel="alternate"/><published>2020-02-27T16:31:05.754000Z</published><updated>2020-02-27T16:31:05.754000Z</updated><author><name>josepmariarams</name><uri>https://forge.codesys.com/u/josepmariarams/</uri></author><id>https://forge.codesys.com7138cacbb1e55e1d021c2037cbe68fdfe4b16cf6</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Have you test baudrate=16#1400 (1 MHz). The codes which expects by sja1000.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Error when opening CAN handle with library</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/cdc7ec1c7c/?limit=25#5b3b" rel="alternate"/><published>2020-02-27T16:31:03.317000Z</published><updated>2020-02-27T16:31:03.317000Z</updated><author><name>dvdende</name><uri>https://forge.codesys.com/u/dvdende/</uri></author><id>https://forge.codesys.comc5c30c1671eaa6063096e2097eed00b9dc7aaeba</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I found in the Codesyscontrol.log an error about the rts_set_baud.sh:&lt;/p&gt;
&lt;p&gt;1474024643: Cmp=CM, Class=1, Error=0, Info=10, pszInfo= System: &amp;lt;cmp&amp;gt;SysMem&amp;lt;/cmp&amp;gt;, &amp;lt;id&amp;gt;0x00000108&amp;lt;/id&amp;gt; &amp;lt;ver&amp;gt;3.5.8.10&amp;lt;/ver&amp;gt;&lt;br/&gt;
1474024643: Cmp=CM, Class=1, Error=0, Info=10, pszInfo= System: &amp;lt;cmp&amp;gt;SysOut&amp;lt;/cmp&amp;gt;, &amp;lt;id&amp;gt;0x0000010b&amp;lt;/id&amp;gt; &amp;lt;ver&amp;gt;3.5.8.10&amp;lt;/ver&amp;gt;&lt;br/&gt;
1474024643: Cmp=CM, Class=1, Error=0, Info=10, pszInfo= System: &amp;lt;cmp&amp;gt;SysModule&amp;lt;/cmp&amp;gt;, &amp;lt;id&amp;gt;0x000001.//rts_set_baud.sh: 3: .//rts_set_baud.sh: ./pcan: not found&lt;br/&gt;
09&amp;lt;/id&amp;gt; &amp;lt;ver&amp;gt;3.5.8.10&amp;lt;/ver&amp;gt;&lt;br/&gt;
1474024643: Cmp=CM, Class=1, Error=0, Info=10, pszInfo= System: &amp;lt;cmp&amp;gt;SysCom&amp;lt;/cmp&amp;gt;, &amp;lt;id&amp;gt;0x00000100&amp;lt;/id&amp;gt; &amp;lt;ver&amp;gt;3.5.8.10&amp;lt;/ver&amp;gt;&lt;br/&gt;
1474024643: Cmp=CM, Class=1, Error=0, Info=10, pszInfo= System: &amp;lt;cmp&amp;gt;SysDir&amp;lt;/cmp&amp;gt;, &amp;lt;id&amp;gt;0x0000011b&amp;lt;/id&amp;gt; &amp;lt;ver&amp;gt;3.5.8.10&amp;lt;/ver&amp;gt;&lt;br/&gt;
1474024643: Cmp=CM, Class=1, Error=0, Info=10, pszInfo= System: &amp;lt;cmp&amp;gt;SysEvent&amp;lt;/cmp&amp;gt;, &amp;lt;id&amp;gt;0x00000102&amp;lt;/id&amp;gt; &amp;lt;ver&amp;gt;3.5.8.10&amp;lt;/ver&amp;gt;&lt;br/&gt;
1474024643: Cmp=CM, Class=1, Error=0, Info=10, pszInfo= System: &amp;lt;cmp&amp;gt;SysInternalLib&amp;lt;/cmp&amp;gt;, &amp;lt;id&amp;gt;0x00000107&amp;lt;/id&amp;gt; &amp;lt;ver&amp;gt;3.5.8.10&amp;lt;/ver&amp;gt;&lt;br/&gt;
1474024&lt;/p&gt;
&lt;p&gt;We use the MCp2515 cjip connected via the SPI interface. I think we need to change this file.&lt;/p&gt;
&lt;p&gt;#!/bin/sh&lt;br/&gt;
CAN_NUM=$(echo $1 | sed 's,^can(&lt;span&gt;[0-9]&lt;/span&gt;&lt;em&gt;).&lt;/em&gt;,\1,')&lt;br/&gt;
./pcan /dev/pcanusb$CAN_NUM $2&lt;/p&gt;
&lt;p&gt;Any help will be highly appreciated!&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Error when opening CAN handle with library</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/cdc7ec1c7c/?limit=25#9bff" rel="alternate"/><published>2020-02-27T16:31:02.425000Z</published><updated>2020-02-27T16:31:02.425000Z</updated><author><name>dvdende</name><uri>https://forge.codesys.com/u/dvdende/</uri></author><id>https://forge.codesys.come8fa82f7993b85dd086b8a5e2ba1125fe72a87ec</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;With The B+ model I could use this code for opening a CAN handle with the CL2 library. Since I migrated for our test system to model 3B it is not functioning anymore. When opening the handle there is an error. I am using the lastest versions 3.5.9.30. On the Pi is the package 3.5.9.20.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;hDriver&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;CAA&lt;/span&gt;.&lt;span class="nv"&gt;gc_hINVALID&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
    &lt;span class="nv"&gt;hDriver&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;CL2&lt;/span&gt;.&lt;span class="nv"&gt;DriverOpenH&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt; &lt;span class="nv"&gt;usiNetId&lt;/span&gt;        :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;usiNetwork&lt;/span&gt;, 
                        &lt;span class="nv"&gt;uiBaudrate&lt;/span&gt;      :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;uiBaudrate&lt;/span&gt;, 
                        &lt;span class="nv"&gt;xSupport29Bits&lt;/span&gt;  :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;xSupport29Bits&lt;/span&gt;, 
                        &lt;span class="nv"&gt;ctMessages&lt;/span&gt;      :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;ctMessages&lt;/span&gt;, 
                        &lt;span class="nv"&gt;peError&lt;/span&gt;     :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;ADR&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;eErrorInternal&lt;/span&gt;&lt;span class="ss"&gt;))&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;I always get eErrorInternal = 1. This number is not in te list of errors. The errors list is starting from 10xxx.&lt;/p&gt;
&lt;p&gt;I hope someone has a clue to fix this problem.&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: CAN error.JPG" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=2172"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>