Hal2Arduino
I'm fully aware of the issues around using an arduino for this purpose and for the time being, I'm ok with those limitations.
However, things are working as expected.
Although I can manually control the motors by talking directly to the serial port, for some reason, when using linuxcnc to drive he motors it doesn't seem to work.
I've set the debug line to report information, but I'm looking for how I can get the user loaded module to show me how to display what it is receiving.
My experience with python is limited, (I'm more familiar with Ruby) so I was wondering if anyone would be able to provide some hints about how to troubleshoot this.
The issue seems to lay within the user loaded python module.
Thoughts?
Ideas?
Suggestions on how to troubleshoot this?
Mike B.
Please Log in or Create an account to join the conversation.
Hal2Arduino is not part of the Linuxcnc project and you assume a familiarity that I doubt many possess.
If you cannot get help from the project itself emc2arduino.wordpress.com/category/hal2arduino/
you will have to attach your full config including
for anyone to have any idea what exactly you are doing.the user loaded module
regards
Please Log in or Create an account to join the conversation.
What would you consider the "full config"?
My assumption is all the .hal files and .ini files?
Mike B.
Please Log in or Create an account to join the conversation.
Thanks for the advice.
What would you consider the "full config"?
My assumption is all the .hal files and .ini files?
Mike B.
Best to zip the whole config folder and include any modules etc that are located elsewhere.
(Will need the arduino script too, to see what that is doing.)
regards
Please Log in or Create an account to join the conversation.
I don't believe there are any modules, since I'm only using the "default" config.
Let me know if there is any other information that would be useful.
Mike B.
Please Log in or Create an account to join the conversation.
The python module is in the config folder, I meant the actual code that is uploaded onto the arduinoI don't believe there are any modules, since I'm only using the "default" config.
The custom.hal file seems to set the pins to connect the stepgens to HAL-2-Arduino.axis_N_joint-pos-cmd pins, so the steps should get through
I don't have any way to test this, although I have a couple of arduinos around, even if I located the arduino script for them and installed it, I have nothing for them to move.
The python module is full of debugging prints already.I've set the debug line to report information, but I'm looking for how I can get the user loaded module to show me how to display what it is receiving.
I think you need to run this from a terminal and you should get a view of what data is being sent and received.
If you need more, you can just add a line in, at the same indentation as the line above, following the format of the others eg
print "commandHandler: interpreted as %d %d %d %d" % (int(dataSet[0]), int(dataSet[1]), int(dataSet[2]), buildSum)
python print is similar to C printf formatting, you should be familiar with something like it in ruby.
Although there does not appear to be any work on the project for the last 3 years, your best option if you cannot make sense of it, might be to try to contact the author through the site
Good Luck
Please Log in or Create an account to join the conversation.
I have run this from a terminal but none of those print statements actually show. It is possible they don't show because the user module goes into its own process(s).
You can see I added some print to file type statements, but the file doesn't seem to get the data either.
It seems like for some reason, the data isn't actually getting processed by the user module at all, although the 'debug.txt' file i have in there does get created.
I have reached out to the Hal2arduino forum and will continue to do so.
Can you point me to some documentation on writing my own user module? I've been through a good deal of the documentation on this site, but just can't seem to find anything around this particular subject.
My main goal was to try and get information on how to debug a loaded user module....any loaded user module...so I can try and debug the issue I have.
Thanks for taking your time to look at it.
Please Log in or Create an account to join the conversation.
This works for me.
Thanks for at least looking at things and providing some suggestions.
Please Log in or Create an account to join the conversation.
the google drive link requires an invutation
but for those interested ,
the project was a python2 suite
and so is complex to use with a recent linuxcnc
today is -6aug2024 and
i had looked into the project
as i was wiriting a way to use arduino
ide compatible bpards for extra io
extra io is not the central use of hal2arduino/emc2arduino
so i am bot investigating firther
but
for those interested
here are notes and file
for a python3 version-
notes below vvv
Hal2Aeduino-notes.txt
06aug2024
Tom Powderly tjtr33
i was working on arduino io subsystem
for emc
( i am dictating this so it has lees typos than i genetrate
I came across Hal2Arduino/EMC2Aeduinoi thought it was a
similar solution that would allow boards compatible with the
arduino ide to be used with linuxcnc
well it does do that
but
does not enable all the io possible...
ppre-reqs
The pcb must hacve serial communications,
usb is hanbdies
tBoard must use the prescrobed protocl
( simpler than jepler's arduuino prorocol)
To discover what Hal2Aeduino could do,
i rewrote the main script for python3
(it was py2 and lib call and prints and range(,,,)
re different)( each change is noted )
and I offer it untested to anyone interested
( the comp ran enough for me to see it was not my path
in general
there are a lot of messages that could be passedfrom
linuxcnc to the arduino board
these messages are likethe nml message...
and are not useful for my project
others may find them useful
it took me a long time to discover
what this system actually did
i suggest for anyone interested can,
study instruction.txt
&the top of the main python file
& the contents of the .ino file
Hal2Arduino it does not give access to all i/o pins
of the arduino ( DI DO AI AO PwmO as i refere to them)
Communicating those data is central to my project
So I stop working with Hal2Arduino
for anyone wanting to try it with python3
here is the up converted file.
note
the code to discover the active
serial ports
that are connected to active arduino type boards
is interesting in i think i will use it
that code makes a list of all active
serial ports
and sens a special message to whatever is connected
it's the connected board replies to the secret handshake
then it is added to a list of connected arduinos
arduinos here meaning a board compatible with the arduino id
basically meaning a board capable of cereal communications
i hope this could be of use choose some users
tomp tjtr33
NB rebane P3HAL2Arduino.tx to P3Hal2Arduino ( noi extent)
make it executable
place in your $PATH
(i put it in .usr.local.bin)
I adfjusted the .ha; for ythe new comp name
find remaining files at Kurt Jacxobson's github
github.com/KurtJacobson/HAL-2-Arduino
Please Log in or Create an account to join the conversation.