I want to use two OneWireMaster on a Raspberry Pi5.
I'm running Codesys Control for Raspberry Pi 64SL V 4.15.0.0.
Under Linux I've configured two GPIOs for 1w bus usage on GPIO4 and GPIO27.
Under Linux both masters seem to work fine and I can readout both sensors connected to both GPIOs.
The two masters are 'w1_bus_master1' and 'w1_bus_master2'.
In Codesys I've configured to OneWireMasters with the corresponding file paths.
But in Codesys the 2nd onewiremaster "w1_bus_master2" doesn't work.
Status is showing "OnewireMaster : Not running"
What am I doing wrong?
Does Codesys on Raspberry support multiple OneWireMasters?
If I add "PlaceholderFilePath.2=/sys/devices/w1_bus_master2, $OneWire2$" to the CODESYScontrol.cfg I can use a 2nd OneWireMaster in the Codesys Runtime. But then my EtherCAT_Master is not working any more.
Any Idea?
Is there any instruction or documentation how a 2nd OneWire Bus Master can be used within Codesys Runtime on a raspberry pi 5?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
All Sensors from the OneWire Master are assigned already to a seperate task with low prio (26) that runs with 1s cycle time.
My EtherCat Task is running with Prio 1.
It all works fine, until I adjust the CODESYScontrol.cfg or the CODESYScontrol_Usr.cfg files so that it supports a 2nd OneWire Master in the Codeys Runtime.
If I change something in this config file and reboot my EtherCat Master stops working.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
the project has only one OneWire Master - so if you add the setting
"PlaceholderFilePath.2=/sys/devices/w1_bus_master2, $OneWire2$ to the config file it will fail and the Ethercat task will be blocked by the OneWire Master readings?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't know why the EtherCat fails, but what happens is:
First I have only one 1WireMaster running on my Raspberry Pi and EtherCat is running fine.
Then I'd like to add a 2nd 1WireMaster.
Therefore I enable a 2nd GPIO Pin on the raspberry in the file "/boot/firmware/config.txt".
To be able to use this 2nd 1WireMaster in Codesys Runtime I Adjust the CODESYScontrol.cfg file and add there: PlaceholderFilePath.2=/sys/devices/w1_bus_master2, $OneWire2$
After a reboot the EtherCat Master is not working any more.
I didn't even add a 2nd OneWire Master in Codesys, but still if I do the EtherCat does not work.
Do you have an idea why?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Could you check the taskcycle time in the taskmonitor (online monitor) - do you really see this 1s on Ethercat Task?
Need to check this on my hardware but will take some time...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I want to use two OneWireMaster on a Raspberry Pi5.
I'm running Codesys Control for Raspberry Pi 64SL V 4.15.0.0.
Under Linux I've configured two GPIOs for 1w bus usage on GPIO4 and GPIO27.
Under Linux both masters seem to work fine and I can readout both sensors connected to both GPIOs.
The two masters are 'w1_bus_master1' and 'w1_bus_master2'.
In Codesys I've configured to OneWireMasters with the corresponding file paths.
But in Codesys the 2nd onewiremaster "w1_bus_master2" doesn't work.
Status is showing "OnewireMaster : Not running"
What am I doing wrong?
Does Codesys on Raspberry support multiple OneWireMasters?
Any help is appreciated.
check if the second onwire master is accessible in the configfile path setting.
/etc/codesyscontrol/
Thx for the hint.
It works if I add following line to the .cfg file.
PlaceholderFilePath.2=/sys/devices/w1_bus_master2, $OneWire2$
Is there a documentation how to modify this config file?
Will this be overwritten if I do an update of the CodesysControl Runtime?
CODESYScontrol.cfg will be overwritten, CODESYSControl_Usr.cfg not.
If I add "PlaceholderFilePath.2=/sys/devices/w1_bus_master2, $OneWire2$" to the CODESYScontrol.cfg I can use a 2nd OneWireMaster in the Codesys Runtime. But then my EtherCAT_Master is not working any more.
Any Idea?
Is there any instruction or documentation how a 2nd OneWire Bus Master can be used within Codesys Runtime on a raspberry pi 5?
Last edit: eschwellinger 2025-10-18
All Sensors from the OneWire Master are assigned already to a seperate task with low prio (26) that runs with 1s cycle time.
My EtherCat Task is running with Prio 1.
It all works fine, until I adjust the CODESYScontrol.cfg or the CODESYScontrol_Usr.cfg files so that it supports a 2nd OneWire Master in the Codeys Runtime.
If I change something in this config file and reboot my EtherCat Master stops working.
hm.. could you add the project or at least parts of it?
yes sure. Thx for your support!
This is the Codesys project stripped down only to my EtherCat and OneWire Configuration.
The Project now contains only one OneWire Master on GPIO4.
the project has only one OneWire Master - so if you add the setting
"PlaceholderFilePath.2=/sys/devices/w1_bus_master2, $OneWire2$ to the config file it will fail and the Ethercat task will be blocked by the OneWire Master readings?
I don't know why the EtherCat fails, but what happens is:
First I have only one 1WireMaster running on my Raspberry Pi and EtherCat is running fine.
Then I'd like to add a 2nd 1WireMaster.
Therefore I enable a 2nd GPIO Pin on the raspberry in the file "/boot/firmware/config.txt".
To be able to use this 2nd 1WireMaster in Codesys Runtime I Adjust the CODESYScontrol.cfg file and add there:
PlaceholderFilePath.2=/sys/devices/w1_bus_master2, $OneWire2$After a reboot the EtherCat Master is not working any more.
I didn't even add a 2nd OneWire Master in Codesys, but still if I do the EtherCat does not work.
Do you have an idea why?
Could you check the taskcycle time in the taskmonitor (online monitor) - do you really see this 1s on Ethercat Task?
Need to check this on my hardware but will take some time...