Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - ESP8266

(you are viewing a thread; or go back to list of threads)

ESP8266 (by Ahmad sakr)
To Ihor Nehrutsa
To José
Is it possible to support ESP8266 in ldmicro as it have many advantages and low cost?
Thanks
Mon Jul 29 2019, 08:42:55
(no subject) (by José)
Hi

The main interest in ESP8266 is Wifi support ; but it has very few IOs.

You may do the same with an Olimex ESP8266 based device:

https://www.olimex.com/Product...I-ESP8266/open-source-hardware

Connect it to a Bluepill board (supported in ldmicro) via UART an you'll do the same for a low price too ?

Best regards
JG
Mon Jul 29 2019, 10:50:50
para Ahmad sakr (by paulino)
It is already in LDmicro version 5.3.10.
https://github.com/LDmicro/LDmicro/releases
Tue Jul 30 2019, 04:24:34
(no subject) (by paulino)
Hi Jose, my question is how to put the pins in the compilation in (C) for 8266 I attached linz, since this is the example.
thanks Paulino (Calubert)


http://cq.cx/ladder-forum.pl?a...;parent=8869&tt=1564057748
Tue Jul 30 2019, 04:56:30
(no subject) (by José)
To Paulino:

I saw your question on the forum, but I don't understand your pb / what you wanna do ?

Explain it and I'll try to answer according to my poor knowledge of ldmicro use...
All the more I'm on holydays in Spain.

José
Tue Jul 30 2019, 05:46:44
Para jose (by paulino)
Hablas español, don de estas en españa.
Do you speak Spanish, where are you in Spain?.

My question is how to put the pins in. .c, for ESP8266.
I attached the lin. where you put the sample software, from LDMicro and the copila in .c,

so that you put me the pins in .c, and I see how it is done and continue with my project, since I saw that it is not done in .hex with the ESP8266, only with ldmicro does it in .c

Mi pregunta es sobre como colocar los pin en. .c, para el ESP8266.
te adjunte el lin. donde coloque el software de ejemplo, de LDMicro y el copila en .c,

para que me pongas los pines en .c, y yo ver como se hace y seguir con mi proyecto, ya que vi que no se hace en .hex con el ESP8266, solo con ldmicro lo hace en .c
Tue Jul 30 2019, 06:20:31
(no subject) (by José)
To Paulino:

I'm near Calpe ; I just speak and understand a few things in spanish ; not enough to use it !

I have compiled your very simple ladder and got a ladder.h and 8266.c and 8266.h files.
But these files cannot be used "as is" with this target because there are no external libraries for 8266 under ldmicro

For your example you must at least redefine in 8266.c file:
Read_Ub_Xabre(void)
Read_Ub_Ysalida(void)
Write_Ub_Ysalida(ldBOOL b)
etc

But the way to redefine them depends on the C compiler you want to use to generate hex file ! So your question has no simple answer !

You may try to compile your ladder to "C for Arduino" in ldmicro ; It'll give you a 8266.cpp file which may be usable with Arduino, which supports 8266 target.

I can't try further more because I don't have any 8266 board.
But there are many tutos about it, like:
https://www.fais-le-toi-meme.f...ecutes-sur-esp8266-arduino-ide

Best regards
José
Wed Jul 31 2019, 11:00:59
(no subject) (by José)

I have studied ESP8266 at leasure time (without having the board), and I have implemented a development tool-chain to program it in C via Gcc and CodeBlocks which seems to work as it generates a bin file from a simple C example.
Thus, I have understood much more how it works.

In fact, ESP8266 is rather difficult to tackle because
- it has a specific processor
- it requires a specific multitask OS to have Wifi working
- it has very few IO pins
- software development is different

In ldmicro, only pin description has been added but there's no way to generate any bin file, and generated C files are absolutely unusable.

The main pb is that ldmicro is a kind of little OS which is difficult to integrate with ESP8266 own Wifi OS.

I think it' possible, but difficult and reserved to developpers... [must call setupPlc() from OS user_init() and use OS timers to call PlcCycle() periodically...

It's more simply to use a Bluepill + an Olimex 8266 device as said above.

JG
Fri Aug 2 2019, 11:54:51
esp8266 (by Segar)
Hi, I was download versionv5.3.0.4 trying for esp8266 but is not working at all ,any have test with esp8266?

thanks
Sat Aug 29 2020, 04:05:28
(no subject) (by José)

I think that everything you need is explain just above ; Esp 8266 can't work "as is" with ldmicro for the time being...
Sat Aug 29 2020, 15:21:24
ESP8266 (by segar)
Hi, i was try to write program in ldmicro versionv5.3.0.4 and compile sketch for Arduino to generate cpp file.I manage to generate cpp file and i was copy that file and paste to Arduino IDE and VARIFY , but there is error and cannot
upload to ESP8266 module. The error is in below

#include "ladder.h"
#include "ladder,h"

after copy past to arduino IDE i receive message from arduino IDE (no such file directory) so what i should do to this message from arduino IDE.

Thank you
Regards
Segar
Mon Aug 31 2020, 09:10:08
(no subject) (by paulino)
If you have to ladder.h put it in the same library.

Si tienes que ladder.h colocarlo en la misma libreria.
Mon Aug 31 2020, 11:15:28
esp8266 (by Segar)
(no subject) (by paulino)
If you have to ladder.h put it in the same library.

what is means?

thanks
Tue Sep 1 2020, 02:17:44
esp8266 (by segar)
yes i was put in same library the file ladder.h


thank
Sun Sep 6 2020, 05:04:58
esp8266 (by Önder Yürekli)
i compiled simple ladder in the atached zip file containing esp8266 using ldmikro Release 32-5.5.c, built 10:35:32 Feb 14 2022.

corrected simple syntax differences and project is now error free and ready.

there ware 2 error source which was very simple. They ware simple syntax errors only.

if you don't include Arduino.h
you must define HIGH and LOW constants.


#ifndef __esp_test_H__
#define __esp_test_H__

#include "ladder.h"
#include "Arduino.h" //------> you must Add Arduino.h here

Second

in ladder.h there ware error at the definition of type bool

orginalliy typedef boolean ldBOOL;

must be changed as follow;

typedef bool ldBOOL;
typedef char SBYTE;
typedef int SWORD;
typedef long int SDWORD;


third
const int analogReference_type =DEFAULT;

change this line as
const int analogReference_type =0;

If you don't use adc remove adc related lines


ldmikro is geting perfect. many thanks jonathan , jose and to all contrubuters.
Fri Mar 4 2022, 02:08:37, download attachment esp_test.rar
(no subject) (by José)
OK

Thanks Önder !
I'll test your ladder with ESP as soon as possible.

I'm developping a new release of ldmicro32 v6 in which Arduino projects will be completely ready to use...
I haven't finished yet for lack of time.

BR
José
Fri Mar 4 2022, 02:51:23
esp8266 (by Önder Yürekli)
There are afew more corrections. I attached visual sutudio project file for platformio ready to open. Code tested on Wmos d1 mini module.

Problem
originally ldmicro produces const int pin_Ub_Yled = -1;
this yields true compilation but false results.

must be corrected like
const int pin_Ub_Yled = 2;

default cpu speed and xtal frq must be corrected as bellow.

#ifndef F_CPU
#define F_CPU 80000000UL
#endif

#define _XTAL_FREQ 26000000UL




i added simple Serial comm under plc_cycle that work perfect.

Speed of esp12e is very high. So additional iot connection can be added ;

Using hc595 and hc165 serial io chips number of i/o can be increased.

ESP12E is 1 usd processor having wifi that could accomodate wifi client wifi acces point and web server. That could break all the walls.

With only one esp12 i produce a device reading sht21,sgp30,pm2.5 sensors run control logic and have ssl connection to my own iot server whic is controlled by our mobile app. At the same time our device performs softAP for config access.

Jose many thank you for your effords. Lets add ESP32. I promise i'll add all iot functionality. If you can ESP8266 is okay too.

We need your help.
Fri Mar 4 2022, 06:25:53, download attachment 220304-113837-esp12e.rar
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):