[Solved] Handshake failed due to invalid Upgrade header: null  



hey guys, i have a problem,

app.remoteme doesn't find my device, in the log , it always shows :

" Handshake failed due to invalid Upgrade header: null "

please help me please.

thanks and sorry about my English


where excatly You've got this message ?
there is at video everything step by step maybe You forgot setting something :  https://www.youtube.com/watch?v=flnsP-gSWLQ
I think it will be something wrong with token please check it out. Also I think You've got this message at browser so please check out if You are logged in. Also please try using newest chrome or firefox. Let me know If You found solution. if not contact me at remoteme.org facebook then i will make remote session with You and I will try to help www.facebook.com/remoteMe.org . Or jsut write me what device You are using and send me its sourcecode


thanks for replay

my device is wemos d1 mini(esp8266)

i get this massage in my dashboard, where you can make Token and manage your devices

actually, i think it found my device ,because it doesn't give me error if there was a Token problem,

do you think it's because of my ip address ? i'm in iran maybe there is a ip filter and it blocks my device,

this project is very important to me,and again ,thank you for answering to me and sorry about my English 🙂


#define WIFI_NAME "parsa"
#define WIFI_PASSWORD "18942001"
#define DEVICE_ID 203
#define DEVICE_NAME "myhome"
#define TOKEN "~338_(zL7U3keFma9G"

#define WEBPAGE_DEVICE_ID 1001

#include <ArduinoHttpClient.h>
#include <RemoteMe.h>
#include <ESP8266WiFi.h>

#include <ESP8266WiFiMulti.h>

#include <RBD_Timer.h>
#include <RBD_Button.h>

uint8_t LEDpin = D5;
RBD::Button button(D2);

ESP8266WiFiMulti WiFiMulti;
RemoteMe& remoteMe = RemoteMe::getInstance(TOKEN, DEVICE_ID);
boolean currentState = false;

void setup() {

while (WiFiMulti.run() != WL_CONNECTED) {


pinMode(LEDpin, OUTPUT);
digitalWrite(LEDpin, LOW);


void onUserSyncMessage(uint16_t senderDeviceId, uint16_t dataSize, uint8_t* data, uint16_t &returnDataSize, uint8_t *&returnData) {
returnDataSize = 1;
returnData = (uint8_t*)malloc(returnDataSize);
Serial.println("received sync message");
uint16_t pos = 0;
RemoteMeMessagesUtils::putUint8(returnData, pos, currentState ? 1 : 0);


void onUserMessage(uint16_t senderDeviceId, uint16_t dataSize, uint8_t *data) {



void changeDiodeState( ) {

currentState= !currentState;

digitalWrite(LEDpin, currentState?HIGH:LOW);

uint16_t returnDataSize = 1;
uint8_t *data = (uint8_t*)malloc(returnDataSize);

uint16_t pos = 0;
RemoteMeMessagesUtils::putUint8(data, pos, currentState?1:0);

remoteMe.sendUserMessage(WEBPAGE_DEVICE_ID, data, returnDataSize);


void loop() {
if (button.onPressed()) {



I have wemos d1 mino so i was able to test your case. I've add your code into my arduino and it works like a harm. Please contact me on facebook we will talk i will make remote session to You and i will see what is wrong, i just need live connection to You