MODBUS using ENC28J60 tcp/ip component isn't working

Use this section to discuss your embedded Flowcode projects.
Emadae3
Posts: 5
http://meble-kuchenne.info.pl
Joined: Fri May 21, 2021 12:02 pm
Has thanked: 1 time

MODBUS using ENC28J60 tcp/ip component isn't working

Post by Emadae3 »

I've been at it for few days now and it's not working for me

setting ENC28j60 component isn't working for me in the first place, setting IP address and mac isn't working as it can't be seen from router (checked with other programmer environment and the Ethernet board works fine) so I am definitely doing something wrong in flowcode.

when I connect "MODBUS TCP SLAVE" component directly to "ENC28j60 " I would get an error in compiling to HEX.
when I use "Network Comms" component , it tells me "ENC28j60" isn't yet supported, yet it compiles anyway

I have to work on "ENC28j60" since other modules aren't available to me.

can anyone please help me , any help is welcome no matter how small (yeah I'm desperate :oops: )
Attachments
MODBUStry16.fcfx
(16.46 KiB) Downloaded 414 times

BenR
Matrix Staff
Posts: 1891
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 488 times
Been thanked: 663 times

Re: MODBUS using ENC28J60 tcp/ip component isn't working

Post by BenR »

Hello,

I think the network comms saying the 28J60 isn't supported yet is the clue to why it isn't working. I'll have a look and see if I can make it work. Its a bit tricky as the 28J60 is very low level and so is a bit of a square peg for a round hole but I'll have a go. We have tried previously and failed but I will investigate for you. Would something like an ESP8266 be an option as this already works?

Emadae3
Posts: 5
Joined: Fri May 21, 2021 12:02 pm
Has thanked: 1 time

Re: MODBUS using ENC28J60 tcp/ip component isn't working

Post by Emadae3 »

yeah it burns, anyway ...

any news ? :?:

ESP8266 doesn't seem to work for me as a medium of communication between Arduino Mega and Modbus Master, I am still a "noob" with communications between micro-controllers .

is it possible to send variables from arduino to modbus master on PC through esp8266 (nodemcu 1 board) in the following format ?

{ VARIABLE_NAME = VARIABLE_VALUE }

there will be multiple of these.

would you be so kind to provide me with a simple such flowcode for a single variable exchange so I can follow and do the rest ?

the modbus master I will be using will not be flowcode app developer.

BenR
Matrix Staff
Posts: 1891
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 488 times
Been thanked: 663 times

Re: MODBUS using ENC28J60 tcp/ip component isn't working

Post by BenR »


Emadae3
Posts: 5
Joined: Fri May 21, 2021 12:02 pm
Has thanked: 1 time

Re: MODBUS using ENC28J60 tcp/ip component isn't working

Post by Emadae3 »

Does this topic help at all?
sadly no , you used esp32 unlike what you wrote in description :
I use an Arduino Uno as my Modbus TCP Slave
you communicated directly to esp32 and used its I/O to show the output depending on the switch in API

what I want to do is to communicate to Arduino Mega (Modbus TCP Slave) through esp8266 (nodemcu) using SPI

esp8266 will be the spi slave while Arduino mega will be the spi master.

perhaps this project is impossible with flowcode :( :?:

to recap : Mega ---variables---> nodemcu ---recieved variables---> SCADA master (modbus tcp)

BenR
Matrix Staff
Posts: 1891
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 488 times
Been thanked: 663 times

Re: MODBUS using ENC28J60 tcp/ip component isn't working

Post by BenR »

Hello,

Yes it certainly should be possible, follow the video and instead of using the ESP32 WIFI component use the ESP8266 Wifi component. Everything else should be the same.

If you get stuck then please post your project file and we will help you.

Brendan
Posts: 44
Joined: Tue Dec 08, 2020 2:12 pm
Has thanked: 35 times
Been thanked: 11 times

Re: MODBUS using ENC28J60 tcp/ip component isn't working

Post by Brendan »

I'm fundamentally a hardware engineer, dependent upon Flowcode to get me by (and very successfully, I might add) for the various professional projects I've developed since 2012. It's been a great ride, with exemplary support along the way.

However, integrating very simple network messaging into a project (basically a comms bridge to replace UART) is turning into a bit of a nightmare - somewhat like trying to educate a software engineer in analogue electronics design - but in reverse, you'll understand.

I've learned so much about embedded coding over the years, but network comms/protocols/etc is quite another matter, so was once again looking to Flowcode to give me the components I require to facilitate high-level programming to code a simple single-client M2M network bridge, reliably replacing simple messaging otherwise performed between MCU and host over wired UART/USB. For this I understand that I require 'single-socket' comms channel over TCP-IP, and have prepared the project with SPI interface and user-configurable parameters (custom IP address, etc), but that's about it.

Initially observing that Flowcode included a component for ENC28J60, I'm now physically wedded to a serious project that's committed to this board. However, as Flowcode's 'Network Comms' component doesn't support this board (suggesting low-level issues perhaps), I fear I might be on a hiding to nowhere for a quick resolution - or is there a simple Flowcode example project somewhere (no web pages, no clutter, just "hello world", "hello back"-esque) that I can shamefully blag from to get the project working and progressively build upon using this particular chip?

Many thanks in advance,
Brendan
Last edited by Brendan on Wed Nov 29, 2023 12:42 pm, edited 1 time in total.

Steve-Matrix
Matrix Staff
Posts: 1377
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 184 times
Been thanked: 318 times

Re: MODBUS using ENC28J60 tcp/ip component isn't working

Post by Steve-Matrix »

Not sure, but maybe this will help?
https://www.matrixtsl.com/resources/fil ... ations.pdf

Brendan
Posts: 44
Joined: Tue Dec 08, 2020 2:12 pm
Has thanked: 35 times
Been thanked: 11 times

Re: MODBUS using ENC28J60 tcp/ip component isn't working

Post by Brendan »

Thank you Steve - Most sincerely appreciated, and drilling down I note the instructional material is relevant to the ENC28J60.

I have but two weeks to get the project working reliably and integrated at system-level, so wish me luck :)

Steve-Matrix
Matrix Staff
Posts: 1377
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 184 times
Been thanked: 318 times

Re: MODBUS using ENC28J60 tcp/ip component isn't working

Post by Steve-Matrix »

Good luck!

I was heavily involved with putting that course together when we first did it (a long time ago!). I've not really looked at it recently though, but I hope it helps your project.

Post Reply