News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

WiFi remote display

Started by shantanu@india, Jan 19, 2022, 12:44 PM

Previous topic - Next topic

shantanu@india

Hi,
A customer wants a running hours display of an industrial compressor based on the factory WiFi network.
Shall I offer them a ESP8266 based solution or are there other options?
Regards
Shantanu

Parmin

I have no solution, but am very interested in this.

Giuseppe MPO


The solution with an ESP8266 is the simplest, but to analyze everything,
you should know how the data is read by the compressor, perhaps RS232?
And how should the data be received, on a mobile phone, on a PC?
Is it sufficient to transmit data on your local network or to be read even remotely from the internet?

shantanu@india

Guiseppe,
There is a RS485 modbus port available in the compressor which might provide lot of machine info but just for the sake of running hours I am thinking of tapping a potential free auxiliary contact from the main contactor and connecting it via an opto to the esp8266 module.
They initially want just a remote display for which I need two esp's on each side. For internet access I might need to use the micropython http/ftp modules to upload data to cloud.
Regards
Shantanu

Giuseppe MPO

I don't understand, if you use a free contact of the contactor it means that you are not reading the temperature but at the most you are reading the status of an alarm.
You can use an ESP for both reading this status and for internet access.
For a similar problem, to read the temperature of remote freezers, I used an ESP01 with a DS18B20 temperature sensor and, using a Telegram BOT,
I can interrogate it to know the current temperature and, possibly, if the temperature exceeds the limits I have. imposed, it sends me alarms.
In this case I used a single ESP that reads the temperature, connects to the internet and sends the data on Telegram.
Then with the mobile phone, without having any other cards, I interrogate or receive alarms from the ESP

shantanu@india

Guiseppe,
Just curious... how did you program your ESP-01...Arduino environment?
Regards
Shantanu

Giuseppe MPO

#include "CTBot.h"
#include <OneWire.h>
#include <DallasTemperature.h>
CTBot myBot;

String Allarme = "on";
String ssid = "xxxxxxx";                                            // WIFI SSID
String pass = "xxxxxxx";                                       // WIFI PASSWORD
String token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";   // TELEGRAM BOT TOKEN
uint32_t MyId = xxxxxxxxxx;
int8_t Soglia = -10;

//#define temperature_topic "sensor/temperature"

//Setup sensor, data wire is connteced to pin 2
#define ONE_WIRE_BUS 2

// Setup a oneWire instance to communicate with any OneWire devices
OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature sensor
DallasTemperature DS18B20(&oneWire);

void setup() {
  DS18B20.begin();
 
  Serial.begin(9600);
  Serial.setTimeout(500);
  Serial.println("\nStarting TelegramBot");

  // connect the ESP8266 to the desired access point
  myBot.wifiConnect(ssid, pass);

  // set the telegram bot token
  myBot.setTelegramToken(token);

  // check if all things are ok
  if (myBot.testConnection())
    Serial.println("Test Connessione OK");
  else
    ESP.reset();

  myBot.sendMessage(MyId,(String)"Esp avviato");
}

void loop() {

  DS18B20.requestTemperatures();
  float temp = DS18B20.getTempCByIndex(0);

  // a variable to store telegram message data
  TBMessage msg;

  // if there is an incoming message...
  if (myBot.getNewMessage(msg)) {
    if (msg.text.equalsIgnoreCase("/Pozzetto")) {
      String reply;
      reply = (String)"Pozzetto = " + temp + (String)"°C";
      myBot.sendMessage(msg.sender.id, reply);
    }
    if (msg.text.equalsIgnoreCase("/Pozz_off")){
    Allarme = "off";
    myBot.sendMessage(MyId,(String)"Allarme pozzetto spento");
    }

     if (msg.text.equalsIgnoreCase("/Pozz_on")) {
    Allarme = "on";
    myBot.sendMessage(MyId,(String)"Allarme pozzetto acceso");
     }
  }
  if (Allarme == "on") {
  if (temp > Soglia) {
    String reply;
    reply = (String)"ALLARME POZZETTO = " + temp + (String)"°C";
    myBot.sendMessage(MyId, reply);
  }
 }
  delay(500);
}




Programmed under Arduino using a Telegram BOT to connect to the internet, and the code is this

shantanu@india

Regards
Shantanu

Ivano

Good evening, I'm interested in this topic. Is it possible to communicate with the ESP8266 via Positron8, given that it also has two I2C pins? On Arduino, you'll only find pre-built connections on dedicated boards and libraries, but no information on how it works or how to control it. It's all plug and play, which is why I don't like Arduino, and the language sometimes doesn't follow any logic. I'd like to understand how to interface with the PIC 18s and what commands to send with Positron, if possible. Then, gradually, increase the difficulty. I'd like to gradually be able to transmit data via Wi-Fi from a PIC18. I don't know if it's possible to do everything with Positron or program the ESP8266 with a dedicated program and then communicate with the PIC 18. If anyone has tried this and can give me some advice, please let me know. Thanks and sorry, Google Translate.

shantanu@india

Hi Ivano,
I am regularly communicating 18F's with ESP32 through SPI. Positron on 18F's side and Micropython(or Arduino C) on ESP32 side. Quite easy & reliable.
Regards
Shantanu

Fanie

Ivano, you are not limited to use any of the existing Arduino boards.  You can design your own board and components as long as you provide for the proper programming pins.

The way it works is you have to select a dummy board which to connect through.  For the ESP32S processors I select the ESP32 Dev Module, and that communicates correctly with the Espressive's ESP-Prog board which is an ESP32 programmer, which gets plugged into my board to be programmed.

The setup works very well, even though it may seem weird to select a dummy board.  When code is compiled, the PC establishes communication with the programmer using the dummy ESP32 Dev Module protocol, and the hex is pumped into the ESP32S chip.  I hope I said that correctly  :o

There are other boards used for programming as well.  I can ask my brother which he uses if you want.
Everything around the ESP's are very universal and available which makes it easy to use, it's only the "See / Sea / C" language which are a pain in the you know what.

The ESP8266 is the older ESP's.  Lots still available for them, but the newer ESP32's have quickly overtaken them.

Now if only the compiler would support the ESP's...  8)

Fanie

This is what is more confusing !
Italian's have names like Leonardo, Edoardo, Tommaso, Francesco, Alessandro, Lorenzo, and Riccardo and even Ivano.

Then here comes a guy named Giuseppe claiming he is from It as well ?
Shouldn't he be Giuseppo at least  ::)

Capisci?

Ivano

Thanks everyone for the advice, I'll do some testing. I came across this WiFi board with an ESP8266 and wanted to try something. From what I understand, I need to use a language supported by ESP to program it and then communicate with the PIC18 programmed for this purpose.Maybe I'll get a board with an ESP32 if it's better and easier to find information about.
They don't know what to invent with Arduino anymore, it's all really confusing. With Positron, everything is easier, it follows a logic and is powerful.

Stephen Moss

Quote from: Ivano on Jan 06, 2026, 08:32 PMThey don't know what to invent with Arduino anymore, it's all really confusing
That because the sky is the limit and you can make everything AI now that Qualcomm has acquired them, so Qualcomm's newly acquired Arduino userbase just can't decide on what new AI enabled Internet of Things Pointless Junk to create, because they are all such great coders and can cope with two processors and AI coding.

Dompie

@Ivano You can look at ANNEX RDS for esp32 and esp8266 Website. It is a Basic Interperter with many, many build in posibilities. Even LVGL is implemented.

Johan

Ivano