Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable 3 serial connexion : {USB, MKS TFT24, WIFI} #82

Closed
moriamoria opened this issue Dec 15, 2024 · 11 comments
Closed

enable 3 serial connexion : {USB, MKS TFT24, WIFI} #82

moriamoria opened this issue Dec 15, 2024 · 11 comments

Comments

@moriamoria
Copy link

Hello,

I like to use 3 connexions for tinybee motherboard (USB, MKS TFT24, WIFI).

I have been able to configure and uses 2 connexions (USB, MKS TFT24)

By the way, I had to invert mkstft24 Tx and Rx, as they are not in the same pin order.

But when I activate ESP3D_WIFISUPPORT, i loose the mks tft24 connexion.

I supose that esp3Dlib overwrite the port number 2. But that just an asumption.

I have test with Marlin bugfix 2.1 and native mks tnybee firmware 2.0.9.2.

Can you help on this?

Regards

Copy link

Thank your for submiting, please be sure you followed template or your issue may be dismissed.

@luc-github
Copy link
Owner

@moriamoria
Copy link
Author

Thanks,

I will do the test.

but the configuration looks strange, as in a previous post, "elensp" clearly told be not to use -1 for serial port :

no, you sequentially enable the number if serial ports you need
SERIAL_PORT, SERIAL_PORT_2 then SERIAL_PORT_3
you assign what ever uart you want to use. to any enabled serial_port (there are some exceptions to this)

Your board has two uarts:
0 is the USB cable
2 is on the exp port for serial displays

-1 is not valid, It is for chips with inbuilt usb in hardware, this board uses a ch340

All you need is
#define SERIAL_PORT 0
and comment out #define SERIAL_PORT_2

I will tell you today my test.

many thanks

@luc-github
Copy link
Owner

to use esp3dlib you need to define a serial port as virtual that also the usage of -1 check https://esp3d.io/ESP3DLib/Version_3.X/installation/

the configuratoon is correct to use esp3dlib

@moriamoria
Copy link
Author

Hello,

I have clone your github, and I have apply your advice :

#define SERIAL_PORT 0
#define SERIAL_PORT_2 -1
#define SERIAL_PORT_3 2

But I have a build error :

Marlin/src/HAL/ESP32/../../module/../inc/../core/serial.h:137:47: error: request for member 'write' in 'multiSerial', which is of non-class type 'SerialOutputT' {aka 'int'}

Can you check your build ?

That will be verry nice

Regards

@luc-github
Copy link
Owner

what branch did you use?

@moriamoria
Copy link
Author

hello,

Update features.ini
origin/ESP3DLib-V3-2.1.2
23/03/2024 01:49:34

regards

@moriamoria
Copy link
Author

Hello,

I forgot the origin :

https://github.com/luc-github/Marlin.git

Regards

@moriamoria
Copy link
Author

Hello,

I got some result by mofifying the integration of your library inside Marlin code.

I really don't know if it is a valid correction, or if I break some coding rules.

my understanding is that we overload MYSERIAL2 with :

typedef ForwardSerial1Class< decltype(Serial2Socket) > DefaultSerial1;
extern DefaultSerial1 MSerial0;
#define MYSERIAL2 MSerial0

So I have just create a new instance of MYSERIAL3 and flushableSerial2

#define MYSERIAL3 flushableSerial2

I post my modified source code for your review if you can.
[ESP32.zip](https://gi
MarlinCore.zip
thub.com/user-attachments/files/18
Marlin.zip
158130/ESP32.zip)

For the moment I failed to do the same modification on the last bugfix 2.1.

I wait for your comments.

Many thanks for the support

Regards

@luc-github
Copy link
Owner

Hello,

I forgot the origin :

https://github.com/luc-github/Marlin.git

Regards

I means you did not follow my link and used the wrong code - so it is normal it is not working

@luc-github
Copy link
Owner

Hello,

I got some result by mofifying the integration of your library inside Marlin code.

I really don't know if it is a valid correction, or if I break some coding rules.

my understanding is that we overload MYSERIAL2 with :

typedef ForwardSerial1Class< decltype(Serial2Socket) > DefaultSerial1;
extern DefaultSerial1 MSerial0;
#define MYSERIAL2 MSerial0

So I have just create a new instance of MYSERIAL3 and flushableSerial2

#define MYSERIAL3 flushableSerial2

I post my modified source code for your review if you can. [ESP32.zip](https://gi MarlinCore.zip thub.com/user-attachments/files/18 Marlin.zip 158130/ESP32.zip)

For the moment I failed to do the same modification on the last bugfix 2.1.

I wait for your comments.

Many thanks for the support

Regards

Sorry I already did a code and it is already available and I gave you the link
why do you want me to spend time on another code made by someone who seems not paying attention of what he is doing and seems also not understand what he is doing ? That is non sense

I close topic now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants