Create a User Editable IP Field

Discussion in 'C-Bus Wiser 2 Controller' started by sjfp, Aug 9, 2021.

  1. sjfp

    sjfp

    Joined:
    Oct 31, 2004
    Messages:
    145
    Likes Received:
    1
    Location:
    UK
    I want to create a a user editable field to allow user to modify an IP address of a 3rd party Controller (AMP) for some reason the unit is not keeping it's set STATIC IP, hence need to be able to modify from Wiser.
    Was going to use a String IO widget, but unfortunately that not user editable.
    So think for breaking the IP down to 4 INT field like p1, p2, p3 p4 then have p1=192 p2=167 etc
    But how can these integers be changed to strings, Wiser doesn't look if you could use IntToStr(p1)

    Any comments or an alternative approach would be appreciated to provide this function.
     
    sjfp, Aug 9, 2021
    #1
  2. sjfp

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,524
    Likes Received:
    173
    Location:
    Adelaide, Australia
    Use the format procedure

    format(outStr, p1:1, '.' , p2:1, '.', p3:1, '.', p4:1);
     
    Ashley, Aug 10, 2021
    #2
  3. sjfp

    Mr Mark

    Joined:
    Jan 27, 2006
    Messages:
    322
    Likes Received:
    5
    Location:
    FNQ
    Hi sjfp.

    Have you tried reserving the IP address for your amp in the router?
    I had a similar problem with a RPi years ago and this was the fix I used.

    Mark
     
    Mr Mark, Aug 10, 2021
    #3
  4. sjfp

    sjfp

    Joined:
    Oct 31, 2004
    Messages:
    145
    Likes Received:
    1
    Location:
    UK
    Many thanks for the two comments, appreciated.
    Was thinking of the router option but really wanted an Wiser APP based solution.
     
    sjfp, Aug 10, 2021
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.