PIC18F25K22 UART ERROR

For general Flowcode discussion that does not belong in the other sections.
chipfryer27
Valued Contributor
Posts: 1191
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 289 times
Been thanked: 418 times

Re: PIC18F25K22 UART ERROR

Post by chipfryer27 »

Hi

Good to hear you are making progress. The ESP as an AP should easily allow multiple connections, but I can't say how many. Interested to hear how many you get connected.

Depending on supplier, the ESP's can be a bit "temperamental" and I'd be keen to hear of the range you actually manage to achieve.

Have a good Easter.

Regards

SILVESTROS
Posts: 90
Joined: Tue Dec 13, 2022 9:04 pm
Has thanked: 24 times
Been thanked: 1 time

Re: PIC18F25K22 UART ERROR

Post by SILVESTROS »

Hi,
I would like to thank you very much for your help, and wish you a good Easter..
I'll continue to make some tests to see if I can use multiple senders with one receiver.
regards

chipfryer27
Valued Contributor
Posts: 1191
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 289 times
Been thanked: 418 times

Re: PIC18F25K22 UART ERROR

Post by chipfryer27 »

Hi

I found a couple of articles that suggest 4 x TCP or 5 x UDP connections (on github) but things depend on the module you are using.

If you are having issues connecting multiple devices to the ESP8266 set as AP, then you could reconfigure it as a client and run via a WiFi router instead. The router will allow multiple connections and will pass data from all your Tx PICs to the Rx.

Regards

SILVESTROS
Posts: 90
Joined: Tue Dec 13, 2022 9:04 pm
Has thanked: 24 times
Been thanked: 1 time

Re: PIC18F25K22 UART ERROR

Post by SILVESTROS »

Hi,
I hope to find you well.. I was checked wifi range ...is about 40 meters with that module ESP8266...Now I would like to extend that range to about 100 meters.. I found that ESP32-WROOM32D can be used to extend renge to 100 meters or more with no change of pcb dimensions of sender..above ESP32 module is a little more larger than ESP8266..FC supports that module, so can I use that module instead of ESP8266, and what modifications are needed to both codes, sender and receiver, with no change of mcu's ?

regards

chipfryer27
Valued Contributor
Posts: 1191
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 289 times
Been thanked: 418 times

Re: PIC18F25K22 UART ERROR

Post by chipfryer27 »

Hi

I'm really impressed that you reached 40m using the 8266's. I never would have imagined that. Well done :)

The ESP32s are very different to the ESP8266 having considerably more processing power. You could probably just use the ESP32 themselves without the Tx PIC's to obtain and process your sensor data before sending.

It might also be worth considering using Flowcode App Developer too. This would allow you to create a FAD program that runs on your PC and connects directly to your Rx ESP via a USB cable.

However as the ESP32 respond to AT Commands like before, it should in theory be possible to just plug them in with maybe just minor mods. I'll try and have a look over the weekend.

Regards

chipfryer27
Valued Contributor
Posts: 1191
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 289 times
Been thanked: 418 times

Re: PIC18F25K22 UART ERROR

Post by chipfryer27 »

Hi

I've only had a quick look at things (big weekend here in the UK and 50 odd other countries too <s>). Not seen anything yet that would stop you just using the ESP32's by themselves without PICs.

However as that may entail you creating new PCBs, something you may not be keen on doing, I can understand just using them as a comms module rather than at their potential.

The only ESP32's I have are modules like this

https://hobbycomponents.com/other-dev-b ... ment-board

I'm not sure if you need to do anything special to have them respond to "AT" commands via UART, I'll try when next in front of one. The actual commands look similar to those of the ESP8266 but I haven't checked too much yet. This would entail sending "AT" commands out using the PIC UART rather than using the FC components though, so changes need to be made to use this option.

I'm not overly familiar with the 32 modules but if attempting to just use them as a WiFi module you may need to include the Network Component too, but that is starting to get a bit messy and overcomplicated. If you absolutely can't just use the modules themselves without PICs, then it may be better to program the ESP32's to act as a transparent link for your PIC. By that I mean when powered it connects to the RX unit and then just passes whatever data comes in on the UART out towards the Receiver. Your PIC is gathering your data and when ready sends it to the ESP32 via UART. The ESP receives the data and then forwards on. Messy but doable.

However at the Rx side you may as well just get rid of the PIC altogether as the ESP would need to process the incoming signal and then send out on the UART to your PIC, so why not just get rid of the PIC and have the ESP connected directly to your PC? That assumes you still want to use Excel DS.

If you are using an ESP module like the one I linked to, it may be easier to just plug it into your PC via the USB port and run Flowcode App Developer to control / gather.

If it were me and using the ESP32's, I would just use them without PICs as it makes it a lot easier.

So you have a few options open to you

1) Control the ESP32s using "AT" commands. Doable but you will need to rewrite everything to send command strings out via the UART.
2) Preprogram the ESP32's to create a transparent link between themselves. Whatever arrives at the input to the Tx ESP will appear at the output of the Rx ESP. No real need for a Rx PIC.
3) Just use the ESP32s by themselves to do everything. At the Rx side you can either continue using Excel DS or run Flowcode App Developer.

Regards

chipfryer27
Valued Contributor
Posts: 1191
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 289 times
Been thanked: 418 times

Re: PIC18F25K22 UART ERROR

Post by chipfryer27 »

Hi

Busy today getting the latest ESP toolchain installed. Seem to be working fine.

If you are still intending to send AT commands then this link may be of help as depending on model, UART1 (accepts AT) is on different pins

https://espressif-docs.readthedocs-host ... ction.html

Regards

chipfryer27
Valued Contributor
Posts: 1191
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 289 times
Been thanked: 418 times

Re: PIC18F25K22 UART ERROR

Post by chipfryer27 »

Hi

From my recent plays with a WROOM, unless you are reflashing I doubt suitability of controlling with AT commands, so that really only leaves you with a couple of options.

TX :- use the ESP to do everything including gathering the sensor data or have it as a "stand alone" module mearly passing data from the PIC
Rx:- use the ESP to pass data to PC. No point at all in utilising the PIC as it is not needed at all.

Regards

SILVESTROS
Posts: 90
Joined: Tue Dec 13, 2022 9:04 pm
Has thanked: 24 times
Been thanked: 1 time

Re: PIC18F25K22 UART ERROR

Post by SILVESTROS »

Hi,
I hope to find you well...I would like to use more than one sender STA ( ESP8266 + PIC18F64K22 ) with one receiver AP ( ESP8266 + PIC18K25K22 ).How can I do this,and how can I change the default IP of ESP8266 that is 198.168.4.1 ?
thanks .

Regards

chipfryer27
Valued Contributor
Posts: 1191
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 289 times
Been thanked: 418 times

Re: PIC18F25K22 UART ERROR

Post by chipfryer27 »

Hi

I assume it is to differentiate players?

An easy way is to simply add in another variable being sent. This variable would be "fixed" per transmitter and you would modify your "send" string to include.

For example lets call this variable "ID" and each transmitter would then have ID=1 or ID=2 or ID=3 etc. When building your data string include "ID" at the beginning.

Now when Excel receives your transmission it will start with the ID of the transmitter followed by your data.

Easy enough to change the IP of the ESP8266 acting as AP (receiver). Once this is changed it will retain the setting until you make any further change to it. You can either check / change during initialisation, or you can make the change by issuing "AT" command whilst connected to a PC/Laptop. I'd probably make the change using my Laptop as it saves potentially unnecessary code.

I don't have the AT commands to hand but I'm pretty sure the format is

AT+command="ip address","gateway address","subnet" (e.g. AT+command="192.168.1.1","192.168.1.1","255.255.255.0")

I'll check when I next get a chance.

Regards

Post Reply