Just to let you know, I have got multi servo operation working nicely from rocrail, and plan to set the servo limits in Data1 and Data2 (user addr_user_base +1 and +2)of the SV associated with that port.
I could not see from the documentation what ucSenType a "servo" should be, but I would like to set the EEPROM reasonably close to LOCOIO SV settings.
I plan to have the other ports as either Block occupancy or digital outputs.. maybe selectable: ucSenType for these should be what?
The document you referenced has:
Input Command to send out
Currently 15 (0x0F)
111 (0x6F) are available
Output Command to look for
Currently 192 (0xC0)
128 (0x80) are available
Which one is expected too identify "block occupany" and which "servo"??
In the code you seem to make the assumption that message will always be 16 bytes.. I agree that is what rocrail sends (so far at least), but the standard suggests that this is a variable length message.. does this need to be taken into account?
I must say I am not very impressed with the consistency of the Loconet Address/ port terminology and use. - But I can work with it...
Presumably its a legacy from small processors and expects each port to be identified with reference to a single address for that "box". And then only allows 4 ports per address?
With the code capability in the NodeMCU I could easily have each physical port addressable by any number from 1-2048, and have them all adjustable: But that would mean any attempts to make the SV's common with other devices would be impossible... On the other hand, this device is much more likely to be set via the webserver, so I am in two minds about adding the complexity to make the SV's readable (and understandable) via LocoIO.
If you still have patience.. can you confirm that to send my OPC_INPUT_REP (0xB2) command I will need to
Where I have to build the sendBLOCKMessage, and it will start with 0xB2, with its Data is defined byg_udp.beginPacket(ipBroad, port);
and A0-A10 are the "address" that Rocrail will be looking for in its "BUS" and "Address" Interface settings.<IN1> =<0,A6,A5,A4- A3,A2,A1,A0>, 7 ls adr bits. A1,A0 select 1 of 4 inputs pairs in a DS54
<IN2> =<0,X,I,L- A10,A9,A8,A7> Report/status bits and 4 MS adr bits.
"I"=0 for DS54 "aux" inputs and 1 for "switch" inputs mapped to 4K SENSOR space.
(This is effectively a least significant adr bit when using DS54 input configuration)
"L"=0 for input SENSOR now 0V (LO) , 1 for Input sensor >=+6V (HI)
"X"=1, control bit , 0 is RESERVED for future!
Many thanks again.. I will upload a sketch when its working a bit better...