element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Interfacing Raspberry Pi 5G HAT with other controller
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 33 replies
  • Answers 1 answer
  • Subscribers 669 subscribers
  • Views 4317 views
  • Users 0 members are here
Related

Interfacing Raspberry Pi 5G HAT with other controller

meera_hussien
meera_hussien over 1 year ago

Gooday,

I am trying to interface the 5G HAT module with the XIAO ESP32C3 module through the UART and also through the USB to TTL, but both are unsuccessful. 

Has anyone tried this method? Or is there a different method that can be used?

Below is the 5G HAT that i am using 

image

https://www.waveshare.com/wiki/RM500Q-GL_5G_HAT.

Appreciate if anyone can help on this

  • Sign in to reply
  • Cancel
  • balajivan1995
    0 balajivan1995 over 1 year ago in reply to balajivan1995

    Also, please check if it's possible change the hardware serial mapping to 1 instead of 0. I believe serial 0 is the default one you use for debugging.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • meera_hussien
    0 meera_hussien over 1 year ago in reply to shabaz

    shabaz , I am trying to communicate through the UART from the ESP32C3 directly with the UART pin on the 40 way connector. But somehow it got stuck here. 

    image

    And the code that i am using is 

    #include <HardwareSerial.h>
    #include <ArduinoJson.h>
    
    HardwareSerial mySerial(1);  
    // Using UART1
    
    
    const int RX_PIN = 9;  
    // Replace with actual RX pin number connected to 5G module
    const int TX_PIN = 10; 
    // Replace with actual TX pin number connected to 5G module
    
    void setup() {
        Serial.begin(9600);  
    // Initialize serial communication for debugging ni optional
    
        mySerial.begin(9600, SERIAL_8N1, RX_PIN, TX_PIN);  
    // Initialize UART1 for 5G module communication
    
        Serial.println("Initializing 5G module...");
        mySerial.write("AT\r\n");  
    
    
        // Check response from 5G module
        while (mySerial.available()) {
            char c = mySerial.read();
            Serial.println(c);  
    
     }
    
    void loop() {
    
    }
    

    And i have checked the D5 function. I noticed there is a onboard switch for it. I tested this code while putting the switch in the ON state as well as in the OFF state. The result are the same for both. 

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • meera_hussien
    0 meera_hussien over 1 year ago in reply to balajivan1995

    Hi balajivan1995 . Thanks for the info. I dont have the CP2102 is in hand. But i tried using this USB to UART controller as in the image below. But it was unsuccessful either.

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • meera_hussien
    0 meera_hussien over 1 year ago in reply to balajivan1995

    I tried using the code above. Still getting the same result

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • meera_hussien
    0 meera_hussien over 1 year ago in reply to balajivan1995

    I tried this as well, but it is still the same.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • balajivan1995
    0 balajivan1995 over 1 year ago in reply to meera_hussien

    1. Verify the data coming from ESP32 by connecting ESP32 Tx pin to Rx Pin of a TTL and use a putty/hterm to view the data from ESP32.

    2. As a next step, connect the Rx/Tx pins of TTL to 5G board, send the "AT\r\n" at different baud rates. My board has a default baudrate of 115200 and check for "OK" response.

    Once you verify these steps connect directly and run the code.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • balajivan1995
    0 balajivan1995 over 1 year ago in reply to balajivan1995

    Don't use Arduino IDE serial monitor. It'll abstract the "\r \n " characters. You need to use hterm which can show each and every byte that's being transmitted and received.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • meera_hussien
    0 meera_hussien over 1 year ago in reply to balajivan1995

    I have tried to change the serial mapping. But it was unsuccessful.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • meera_hussien
    0 meera_hussien over 1 year ago in reply to balajivan1995

    balajivan1995 , i connected the ESP32 with the TTL and can view the data that i am sending from from the ESP32. As shown in the image below

    image


    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • meera_hussien
    0 meera_hussien over 1 year ago in reply to meera_hussien

    i used the hterm and i get this result

    image

    Does this looks good?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
<>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube