#lighthack wifi

Hello, I am trying to create a wifi box. Using the available code, I made some modifications to use esp8266, I got it to work halfway. In the EOS terminal I see that it receives ping and subcrisciption of parameters. The problem is in the last part of the code when we ask that you receive parameters from EOS.

the original code says

// Then we check to see if any OSC commands have come from Eos
// and update the display accordingly.
size = SLIPSerial.available();
if (size > 0)
{
// Fill the msg with all of the available bytes
while (size--)
curMsg += (char)(SLIPSerial.read());
}
if (SLIPSerial.endofPacket())
{
parseOSCMessage(curMsg);
lastMessageRxTime = millis();
// We only care about the ping if we haven't heard recently
// Clear flag when we get any traffic
timeoutPingSent = false;
curMsg = String();
}
if (lastMessageRxTime > 0)
{
unsigned long diff = millis() - lastMessageRxTime;
//We first check if it's been too long and we need to time out
if (diff > TIMEOUT_AFTER_IDLE_INTERVAL)
{
connectedToConsole = ConsoleNone;
lastMessageRxTime = 0;
updateDisplay = true;
timeoutPingSent = false;
}
//It could be the console is sitting idle. Send a ping once to
// double check that it's still there, but only once after 2.5s have passed
if (!timeoutPingSent && diff > PING_AFTER_IDLE_INTERVAL)
{
OSCMessage ping("/eos/ping");
ping.add(BOX_NAME_STRING "_hello"); // This way we know who is sending the ping
SLIPSerial.beginPacket();
ping.send(SLIPSerial);
SLIPSerial.endPacket();
timeoutPingSent = true;
}
}
if (updateDisplay)
displayStatus();
}

and I'm trying to do it that way

size = Udp.available();
if (size > 0)
{
// Fill the msg with all of the available bytes
while (size--)
curMsg += (char)(Udp.read());
}
if (Udp.endofPacket())
{
parseOSCMessage(curMsg);
lastMessageRxTime = millis();
// We only care about the ping if we haven't heard recently
// Clear flag when we get any traffic
timeoutPingSent = false;
curMsg = String();
}

if (lastMessageRxTime > 0)
{
unsigned long diff = millis() - lastMessageRxTime;
//We first check if it's been too long and we need to time out
if (diff > TIMEOUT_AFTER_IDLE_INTERVAL)
{
connectedToConsole = ConsoleNone;
lastMessageRxTime = 0;
updateDisplay = true;
timeoutPingSent = false;
}

//It could be the console is sitting idle. Send a ping once to
// double check that it's still there, but only once after 2.5s have passed
if (!timeoutPingSent && diff > PING_AFTER_IDLE_INTERVAL)
{
OSCMessage ping("/eos/ping");
ping.add(BOX_NAME_STRING "_hello"); // This way we know who is sending the ping
Udp.beginPacket(outIp, outPort);
ping.send(Udp);
Udp.endPacket();
timeoutPingSent = true;
}
}

if (updateDisplay)
displayStatus();
}
}

I have the problem in the line marked in red. what would be the correct way to translate this for "Udp"?

Thanks!!

Parents
  • There is no method endOfPacket() for UDP. Let the if statement away.

  • The main problem is the use of size = Udp.available(); you must use size = Udp.parsePacket();
    I attached a 
    cleaned code without cobalt and color source stuff. Hope it works because I cannot test it with a real environment.
    enviar_3.zip

  • hello sstaub! Thank you for this. It starts to work but I still have some problems, I have to skip this part so that Pan and til appears on my screen:

    // if (! connectedToEos)
      // {
    // display a splash message before the Eos connection is open
    //lcd.setCursor(0, 0);
    //lcd.print(String("Box1 v "+ VERSION_STRING) .c_str ());
    //lcd.setCursor(0, 1);
    //lcd.print("waiting for eos ");
    //}
      // else

    Another error also occurs, if I do not have a selected channel, my arduino does not stop restarting.

    Exception (28):
    epc1 = 0x40202f28 epc2 = 0x00000000 epc3 = 0x00000000 excvaddr = 0x00000008 depc = 0x00000000

    >>> stack >>>

    ctx: cont
    sp: 3ffffd70 end: 3fffffc0 offset: 01a0
    3fffff10: 00000001 00000000 3fffff30 40203058
    3fffff20: 3ffee448 ffffffff 3ffee448 40201546
    3fffff30: 3ffef714 00000000 00000000 00000004
    3fffff40: 00000005 3ffef894 00000000 00000010
    3fffff50: 3fffdad0 00000000 3ffee4b8 40201cb4
    3fffff60: 007a1200 4a086cf4 3ffee600 00000003
    3fffff70: 00000000 3ffee4b8 3ffee62c 40201bd2
    3fffff80: 00000000 00000000 00000001 40100154
    3fffff90: 3fffdad0 00000000 3ffee664 3ffee6a4
    3fffffa0: 3fffdad0 00000000 3ffee664 40204ff4
    3fffffb0: feefeffe feefeffe 3ffe850c 40100e65
    <<< stack <<<

  • I tested a little bit with an Arduino WIFIv2 board and I have also many problems, so I stopped working.
    Generally that WIFI is not very stable, I think there are many problems with the Arduino framework.
    I think the connection must permanently tested and reconnected.

  • making some changes (adding issueSubscribes (); in the loop and skipping the "waiting for eos" screen I get it to work without problems.) but if I don't have a fixture selected or I have one that doesn't use pan and til my arduino restarts.

    Exception (28):
    epc1=0x40202f8c epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000008 depc=0x00000000

    >>>stack>>>

    ctx: cont
    sp: 3ffffd70 end: 3fffffc0 offset: 01a0
    3fffff10: 00000001 00000000 3fffff30 402030bc
    3fffff20: 3ffee4e8 ffffffff 3ffee4e8 40201546
    3fffff30: 3fff01bc 00000000 00000000 00000004
    3fffff40: 00000005 3fff0184 00000000 00000010
    3fffff50: 3fffdad0 00000000 3ffee558 40201d18
    3fffff60: 007a1200 e686af92 80000000 00000000
    3fffff70: 00000000 3fff010c 00000000 00000010
    3fffff80: 00000000 00000000 00000001 40100154
    3fffff90: 3fffdad0 00000000 3ffee704 3ffee744
    3fffffa0: 3fffdad0 00000000 3ffee704 40205330
    3fffffb0: feefeffe feefeffe 3ffe850c 401011b5
    <<<stack<<<

    ets Jan 8 2013,rst cause:2, boot mode:(3,6)

    load 0x4010f000, len 1384, room 16
    tail 8
    chksum 0x2d
    csum 0x2d
    vbc204a9b
    ~ld

    exception decorder

    Exception 28: LoadProhibited: A load referenced a page mapped with an attribute that does not permit loads
    PC: 0x40202f8c: OSCData::getFloat() at /Users/jefatecnico/Documents/Arduino/libraries/OSC-master/OSCData.cpp line 191
    EXCVADDR: 0x00000008
    
    Decoding stack results
    0x402030bc: OSCMessage::route(char const*, void (*)(OSCMessage&, int), int) at /Users/jefatecnico/Documents/Arduino/libraries/OSC-master/OSCMessage.cpp line 391
    0x40201546: parseOSCMessage(String&) at /Users/jefatecnico/Downloads/enviar_3 6/enviar_3/enviar_3.ino line 245
    0x40201d18: loop() at /Users/jefatecnico/Downloads/enviar_3 6/enviar_3/enviar_3.ino line 568
    0x40100154: ets_post(uint8, ETSSignal, ETSParam) at /Users/jefatecnico/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.2/cores/esp8266/core_esp8266_main.cpp line 160
    0x40205330: loop_wrapper() at /Users/jefatecnico/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.2/cores/esp8266/core_esp8266_main.cpp line 180
    
  • Maybe that is the USB for Serial. Try to let the USB disconnected to the computer where nomad is installed.

  • No, it's a problem remains the same. I think it has something to do with that there is no parameter update

Reply Children
No Data