3 Fixed syntax highlighting and grammar.
source | link

I am trying to send data from one node mcu to another using the same wifi for now. I can publish the data since iI can see it from my pubnub analytics but not able to receive the data. When iI used 2 different node mcu then receiver node mcu just showed random symbols on serial port reading so I am testing below code on just one node mcu for now.

sprintf(buf, "\"%d\",\"%d\",\"%d\",\"%d\",\"%d\"", shoulder_yaw, shoulder_pitch, biceps_variable, biceps_roll, arm_pitch);

    Serial.println("buf: "); Serial.print(buf);




    PubNonSubClient *pclient = PubNub.publish(pubchannel, buf);
    if (!pclient) return;
    PublishCracker cheez;
    cheez.read_and_parse(pclient);

    delay(1000);
/*
    Serial.print("Outcome: "); Serial.print(cheez.outcome());
    Serial.print(' '); Serial.println(cheez.to_str(cheez.outcome()));
    Serial.print("description: "); Serial.println(cheez.description());
    Serial.print("timestamp: "); Serial.println(cheez.timestamp());
    Serial.print("state: "); Serial.print(cheez.state());
    Serial.print(' '); Serial.println(cheez.to_str(cheez.state()));
*/
    pclient->stop();

    PubSubClient *sclient = PubNub.subscribe(subchannel);
    if (!sclient) return; // error
    String msg;
    SubscribeCracker ritz(sclient);
    while (!ritz.finished()) {
        ritz.get(msg);
        if (msg.length() > 0) {
            Serial.print("Received: "); Serial.println(msg);
        }
    }
    delay(1000);
    sclient->stop();
    sprintf(buf, "\"%d\",\"%d\",\"%d\",\"%d\",\"%d\"", shoulder_yaw, shoulder_pitch, biceps_variable, biceps_roll, arm_pitch);

    Serial.println("buf: "); Serial.print(buf);

    PubNonSubClient *pclient = PubNub.publish(pubchannel, buf);
    if (!pclient) return;
    PublishCracker cheez;
    cheez.read_and_parse(pclient);

    delay(1000);
/*
    Serial.print("Outcome: "); Serial.print(cheez.outcome());
    Serial.print(' '); Serial.println(cheez.to_str(cheez.outcome()));
    Serial.print("description: "); Serial.println(cheez.description());
    Serial.print("timestamp: "); Serial.println(cheez.timestamp());
    Serial.print("state: "); Serial.print(cheez.state());
    Serial.print(' '); Serial.println(cheez.to_str(cheez.state()));
*/
    pclient->stop();

    PubSubClient *sclient = PubNub.subscribe(subchannel);
    if (!sclient) return; // error
    String msg;
    SubscribeCracker ritz(sclient);
    while (!ritz.finished()) {
        ritz.get(msg);
        if (msg.length() > 0) {
            Serial.print("Received: "); Serial.println(msg);
        }
    }
    delay(1000);
    sclient->stop();

I am trying to send data from one node mcu to another using the same wifi for now. I can publish the data since i can see it from my pubnub analytics but not able to receive the data. When i used 2 different node mcu then receiver node mcu just showed random symbols on serial port reading so I am testing below code on just one node mcu for now.

sprintf(buf, "\"%d\",\"%d\",\"%d\",\"%d\",\"%d\"", shoulder_yaw, shoulder_pitch, biceps_variable, biceps_roll, arm_pitch);

    Serial.println("buf: "); Serial.print(buf);




    PubNonSubClient *pclient = PubNub.publish(pubchannel, buf);
    if (!pclient) return;
    PublishCracker cheez;
    cheez.read_and_parse(pclient);

    delay(1000);
/*
    Serial.print("Outcome: "); Serial.print(cheez.outcome());
    Serial.print(' '); Serial.println(cheez.to_str(cheez.outcome()));
    Serial.print("description: "); Serial.println(cheez.description());
    Serial.print("timestamp: "); Serial.println(cheez.timestamp());
    Serial.print("state: "); Serial.print(cheez.state());
    Serial.print(' '); Serial.println(cheez.to_str(cheez.state()));
*/
    pclient->stop();

    PubSubClient *sclient = PubNub.subscribe(subchannel);
    if (!sclient) return; // error
    String msg;
    SubscribeCracker ritz(sclient);
    while (!ritz.finished()) {
        ritz.get(msg);
        if (msg.length() > 0) {
            Serial.print("Received: "); Serial.println(msg);
        }
    }
    delay(1000);
    sclient->stop();

I am trying to send data from one node mcu to another using the same wifi for now. I can publish the data since I can see it from my pubnub analytics but not able to receive the data. When I used 2 different node mcu then receiver node mcu just showed random symbols on serial port reading so I am testing below code on just one node mcu for now.

    sprintf(buf, "\"%d\",\"%d\",\"%d\",\"%d\",\"%d\"", shoulder_yaw, shoulder_pitch, biceps_variable, biceps_roll, arm_pitch);

    Serial.println("buf: "); Serial.print(buf);

    PubNonSubClient *pclient = PubNub.publish(pubchannel, buf);
    if (!pclient) return;
    PublishCracker cheez;
    cheez.read_and_parse(pclient);

    delay(1000);
/*
    Serial.print("Outcome: "); Serial.print(cheez.outcome());
    Serial.print(' '); Serial.println(cheez.to_str(cheez.outcome()));
    Serial.print("description: "); Serial.println(cheez.description());
    Serial.print("timestamp: "); Serial.println(cheez.timestamp());
    Serial.print("state: "); Serial.print(cheez.state());
    Serial.print(' '); Serial.println(cheez.to_str(cheez.state()));
*/
    pclient->stop();

    PubSubClient *sclient = PubNub.subscribe(subchannel);
    if (!sclient) return; // error
    String msg;
    SubscribeCracker ritz(sclient);
    while (!ritz.finished()) {
        ritz.get(msg);
        if (msg.length() > 0) {
            Serial.print("Received: "); Serial.println(msg);
        }
    }
    delay(1000);
    sclient->stop();
2 deleted 7 characters in body
source | link

I am trying to send data from one node mcu to another using the same wifi for now. I can publish the data since i can see it from my pubnub analytics but not able to receive the data. When i used 2 different node mcu then receiver node mcu just showed random symbols on serial port reading so I am testing below code on just one node mcu for now.

Code:-

sprintf(buf, "\"%d\",\"%d\",\"%d\",\"%d\",\"%d\"", shoulder_yaw, shoulder_pitch, biceps_variable, biceps_roll, arm_pitch);

    Serial.println("buf: "); Serial.print(buf);




    PubNonSubClient *pclient = PubNub.publish(pubchannel, buf);
    if (!pclient) return;
    PublishCracker cheez;
    cheez.read_and_parse(pclient);

    delay(1000);
/*
    Serial.print("Outcome: "); Serial.print(cheez.outcome());
    Serial.print(' '); Serial.println(cheez.to_str(cheez.outcome()));
    Serial.print("description: "); Serial.println(cheez.description());
    Serial.print("timestamp: "); Serial.println(cheez.timestamp());
    Serial.print("state: "); Serial.print(cheez.state());
    Serial.print(' '); Serial.println(cheez.to_str(cheez.state()));
*/
    pclient->stop();

    PubSubClient *sclient = PubNub.subscribe(subchannel);
    if (!sclient) return; // error
    String msg;
    SubscribeCracker ritz(sclient);
    while (!ritz.finished()) {
        ritz.get(msg);
        if (msg.length() > 0) {
            Serial.print("Received: "); Serial.println(msg);
        }
    }
    delay(1000);
    sclient->stop();

cheez.to_str(cheez.state()) shows the data which I am sending but IOn my pubnub account, i am not able to send and receive data but its not showing on com port. Does anyone know what is the problem here?

com port

I am trying to send data from one node mcu to another using the same wifi for now. I can publish the data since i can see it from my pubnub analytics but not able to receive the data. When i used 2 different node mcu then receiver node mcu just showed random symbols on serial port reading so I am testing below code on just one node mcu for now.

Code:-

sprintf(buf, "\"%d\",\"%d\",\"%d\",\"%d\",\"%d\"", shoulder_yaw, shoulder_pitch, biceps_variable, biceps_roll, arm_pitch);

    Serial.println("buf: "); Serial.print(buf);




    PubNonSubClient *pclient = PubNub.publish(pubchannel, buf);
    if (!pclient) return;
    PublishCracker cheez;
    cheez.read_and_parse(pclient);

    delay(1000);
/*
    Serial.print("Outcome: "); Serial.print(cheez.outcome());
    Serial.print(' '); Serial.println(cheez.to_str(cheez.outcome()));
    Serial.print("description: "); Serial.println(cheez.description());
    Serial.print("timestamp: "); Serial.println(cheez.timestamp());
    Serial.print("state: "); Serial.print(cheez.state());
    Serial.print(' '); Serial.println(cheez.to_str(cheez.state()));
*/
    pclient->stop();

    PubSubClient *sclient = PubNub.subscribe(subchannel);
    if (!sclient) return; // error
    String msg;
    SubscribeCracker ritz(sclient);
    while (!ritz.finished()) {
        ritz.get(msg);
        if (msg.length() > 0) {
            Serial.print("Received: "); Serial.println(msg);
        }
    }
    delay(1000);
    sclient->stop();

cheez.to_str(cheez.state()) shows the data which I am sending but I am not able to receive data. Does anyone know what is the problem here?

com port

I am trying to send data from one node mcu to another using the same wifi for now. I can publish the data since i can see it from my pubnub analytics but not able to receive the data. When i used 2 different node mcu then receiver node mcu just showed random symbols on serial port reading so I am testing below code on just one node mcu for now.

Code:-

sprintf(buf, "\"%d\",\"%d\",\"%d\",\"%d\",\"%d\"", shoulder_yaw, shoulder_pitch, biceps_variable, biceps_roll, arm_pitch);

    Serial.println("buf: "); Serial.print(buf);




    PubNonSubClient *pclient = PubNub.publish(pubchannel, buf);
    if (!pclient) return;
    PublishCracker cheez;
    cheez.read_and_parse(pclient);

    delay(1000);
/*
    Serial.print("Outcome: "); Serial.print(cheez.outcome());
    Serial.print(' '); Serial.println(cheez.to_str(cheez.outcome()));
    Serial.print("description: "); Serial.println(cheez.description());
    Serial.print("timestamp: "); Serial.println(cheez.timestamp());
    Serial.print("state: "); Serial.print(cheez.state());
    Serial.print(' '); Serial.println(cheez.to_str(cheez.state()));
*/
    pclient->stop();

    PubSubClient *sclient = PubNub.subscribe(subchannel);
    if (!sclient) return; // error
    String msg;
    SubscribeCracker ritz(sclient);
    while (!ritz.finished()) {
        ritz.get(msg);
        if (msg.length() > 0) {
            Serial.print("Received: "); Serial.println(msg);
        }
    }
    delay(1000);
    sclient->stop();

On my pubnub account, i am able to send and receive data but its not showing on com port. Does anyone know what is the problem here?

com port

1
source | link

Not able to receive data on node mcu from pubnub

I am trying to send data from one node mcu to another using the same wifi for now. I can publish the data since i can see it from my pubnub analytics but not able to receive the data. When i used 2 different node mcu then receiver node mcu just showed random symbols on serial port reading so I am testing below code on just one node mcu for now.

Code:-

sprintf(buf, "\"%d\",\"%d\",\"%d\",\"%d\",\"%d\"", shoulder_yaw, shoulder_pitch, biceps_variable, biceps_roll, arm_pitch);

    Serial.println("buf: "); Serial.print(buf);




    PubNonSubClient *pclient = PubNub.publish(pubchannel, buf);
    if (!pclient) return;
    PublishCracker cheez;
    cheez.read_and_parse(pclient);

    delay(1000);
/*
    Serial.print("Outcome: "); Serial.print(cheez.outcome());
    Serial.print(' '); Serial.println(cheez.to_str(cheez.outcome()));
    Serial.print("description: "); Serial.println(cheez.description());
    Serial.print("timestamp: "); Serial.println(cheez.timestamp());
    Serial.print("state: "); Serial.print(cheez.state());
    Serial.print(' '); Serial.println(cheez.to_str(cheez.state()));
*/
    pclient->stop();

    PubSubClient *sclient = PubNub.subscribe(subchannel);
    if (!sclient) return; // error
    String msg;
    SubscribeCracker ritz(sclient);
    while (!ritz.finished()) {
        ritz.get(msg);
        if (msg.length() > 0) {
            Serial.print("Received: "); Serial.println(msg);
        }
    }
    delay(1000);
    sclient->stop();

cheez.to_str(cheez.state()) shows the data which I am sending but I am not able to receive data. Does anyone know what is the problem here?

com port