Can't connect to port 8883 with 5100 Shield


i'm new using ethernet shield. 

i'm able connect mqtt server using arduino insecurely (over port 1883).
i'm able connect mqtt server using raspberry pi securely (over port 8883).
however, cannot connect port 8883 arduino.

i've read every post out there , can't tell if it's sketch or it's impossible. can tell me definitively if won't work or problem code?

code: [select]
#include <spi.h>
#include <ethernet.h>
#include "pubsubclient.h"

//
//#define client_id         "boilerroom"
//#define username        ""
//#define password        ""
//#define server             "192.168.0.222"
//#define port                 1883

#define client_id      "boilerroom"
#define username      "mudmin"
#define password     "password"
#define server          "mqttserver.domain.com"
#define port              8883


#define interval        3000 // 3 sec delay between publishing

byte mac[] = {  0xde, 0xad, 0xbe, 0xef, 0xfe, 0xed };
ipaddress ip(192,168,0,223);
ethernetclient ethclient;
pubsubclient mqttclient;

long previousmillis;

void setup() {
    // disable sd card if 1 in slot
  pinmode(4,output);
  digitalwrite(4,high);

  // setup serial communication
  serial.begin(9600);
  // setup ethernet communication using dhcp
  if(ethernet.begin(mac) == 0) {
    serial.println(f("ethernet configuration using dhcp failed"));
    for(;;);
  }
  // setup mqtt client
  mqttclient.setclient(ethclient);
  mqttclient.setserver(server,port);
  serial.println(f("mqtt client configured"));

  previousmillis = millis();
}

void loop() {
  // check interval
  if(millis() - previousmillis > interval) {
    senddata();
    previousmillis = millis();
  }
  mqttclient.loop();
}

void senddata() {
  char msgbuffer[20];

  if(mqttclient.connect(client_id, username, password)) {
   mqttclient.publish("hello", "world");

 }
}

does arduino support https?
last time checked didn't because of memory , processing constraints.

one hack use point point wifi wpa encryption instead of wired connection. you'll still using http it'll secure.


Arduino Forum > Using Arduino > Networking, Protocols, and Devices (Moderator: fabioc84) > Can't connect to port 8883 with 5100 Shield


arduino

Comments

Popular posts from this blog

Flip address is out of range arduino uno r3

Arduino Uno not uploading

Indesign and MathType fonts