how to get authentication working with DxP and Ruby?

how to get authentication working with DxP and Ruby?

Postby cstump » September 13th, 2013, 12:21 pm

Hi. I need to control an iPIO-8 with a Ruby application. I've made progress by following the Python (http://dataprobe.co/support/ipio/ipio_python_1.2.zip) and C (http://dataprobe.co/support/shared/dxp_1.2.c.zip) examples. I can control the device if the "Use DxP Username and Password" option under iPIO-8 network setup is not checked. If the option is checked, however, both the Python script and my Ruby version fail. Passwords and usernames don't seem to be handled properly in the Python example. What are the requirements for passwords and usernames? It looks like they need to be 21 characters long, padded with 'P' and 'U' for password and username respectively, and are not delimited in the command string sent to the iPIO-8. However, that doesn't seem to work. Furthermore in the C example usernames and passwords are handled differently. They are 21 characters in length and seem to be padded with null characters. When I try to replicate in Ruby this fails. Please help me out here. Thanks!
cstump
 
Posts: 2
Joined: September 11th, 2013, 2:26 pm

Re: how to get authentication working with DxP and Ruby?

Postby cstump » September 17th, 2013, 6:29 pm

I figured this out. Both the username and password need to be of length 21. Unused bytes should be null (in Ruby that's "\x00". In C that's "\0"). Furthermore, when testing on the iPIO-8 test with a non-admin user.

Here is a code example in Ruby for controlling a relay and checking its status via a iPIO-8: https://github.com/tablexi/nucore-open/ ... be/ipio.rb

Here is a test for that example: https://github.com/tablexi/nucore-open/ ... io_spec.rb
cstump
 
Posts: 2
Joined: September 11th, 2013, 2:26 pm


Return to Remote Control (iPIO-8)

Who is online

Users browsing this forum: No registered users and 1 guest

cron