So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By schufti
#72970 the problem is clear:

client.publish();

awaits two (pointers to) character arrays as arguments (as the errormessage clearly states), but you tried to pass one integer (buttonPushCounter) and I foolishly assumed it might also take string.

so maybe sth like
Code: Select allmsg = itoa(buttonPushCounter,msg,10)
client.publish("OsoyooDataF",msg);

may actually work ...
User avatar
By Gdipstick
#72982 thanks for the advice, but it seems like it's conflicting with an assignment at the beginning of the sketch...

char msg[50];

how can we reconcile this?


Arduino: 1.8.2 (Windows 7), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, 115200, 4M (3M SPIFFS)"

C:\Users\GADAWE\Documents\Arduino\node_ct_rgb_box\node_ct_rgb_box.ino: In function 'void loop()':

node_ct_rgb_box:136: error: incompatible types in assignment of 'char*' to 'char [50]'

msg = itoa(buttonPushCounter,msg,10);

^

exit status 1
incompatible types in assignment of 'char*' to 'char [50]'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.