Nominate our 2022 Qt Champions!

QTcpServer QTcpSocket between pc and 3g cell phone

  • !!

    Hi, I am not sure if this is the right place to post it, but ill try anyway,
    Im french by the way, i'll try to be as clear as possible
    I'll begin by a description of my project for people to give me accurate suggestion regarding my problem:

    I want to 3d print a RC car with my printer and be able to control it via the cellular network with a video stream to be able to control it from my pc at home. A arduino uno will be installed on the RC car to take care of the motor, servo etc. At the begining I tough of using a 3g shield for arduino, but the price is too high (180$) and I want to code the remote end in Qt since its powerfull and I don't want to learn java. So I want to use my nexus 5 as the 3g antenna. I will then write a program with Qt for android that will talk to the arduino, but since QSerialPort isn't supported with android, I will plug a UART bluetooth COM adapter to the arduino and establish a serial com over bluetooth. Second step is to establish a connection from my nexus 5 running my Qt programm to my Qt controller programm on my pc. I based myself on the fortune client and server exemple to create a QTcpSocket and a QTcpServer on both end (server on the android and client on the pc). I linked a picture for people to understand the link between my components. First, the pc send a string of command ( Like 'forward' 'left' 'right' etc) trough the tcp socket to the tcpserver on the android. Second the android sends the commend trough the bluetooth serial comm, forwarding it to the arduino. The android will at the same time send a video stream from a QCamera object like, to the pc to be able to view where it goes.

    My problem is :

    My code is not yet finished for the android end, but it should work if everything is used on a local network (fortune server exemble runs fine between android and pc) but I don't have a clue on how It will work once my cell phone, installed on the RC car, will be in the streets. Since the fortune server and client work locally, I would like someone to point me the way to go if I want to use QTcpServer and QTcpSocket between the public ip of my cell phone and the pc.

    I am not a network professional, nor a professional Qt programmer, but until communicating trough the internet, I should be able to make my way trough.

    To resume, how would I be able to send a video stream and basic string commends trough a QTcpSocket and QTcpServer like in the fortune exemble, but trough the cellular network? I tried to setup a VPN connection between myh pc and my cellphone, but unsuccessful until now and even if it was, I have no clue where to go from there.

    Thanks to everyone who take time to read my whole story and help me out, this is a very meaningful project to me! I am new to Qt, but I understand well ( already coded the bluetooth part and arduino code)

Log in to reply