Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - awkutchins

Pages: [1]
1
QB64 Discussion / Re: OpenClient trouble
« on: June 01, 2020, 02:33:41 pm »
Ok so an update:
I found a nice demo in another forum post here: https://www.qb64.org/forum/index.php?topic=1389.msg105754#msg105754
I copied the code into to qb64 programs on my pc and it worked beautifully.

I then moved the host program to my raspberry pi and changed the ip address on the client program (I tried a few) and still the same problem.

I then tried to see if I could get both programs to on the pi and it can't connect. So I think it might be something with the Pi not being able to listen to a port properly or a missing library or something. I'm not too sure where to go from here tho.

After work I'm going to try to run the client program on a different pc and the host on my pc to see if I can get a connection on different devices period.

If anyone has any ideas or places for me to look I will be so grateful.


2
QB64 Discussion / Re: OpenClient trouble
« on: May 31, 2020, 01:00:35 am »
Would it be relevant if I were trying to connect from the outside internet? I'm not currently but I plan to expand it to have my three friends' computers (and mine) connected all on different networks.

I updated my server code to:
Code: QB64: [Select]
  1. PRINT "Connecting to port..."
  2. hostHandle& = _OPENHOST("TCP/IP:53020")
  3. hostName$ = _CONNECTIONADDRESS$(hostHandle&)
  4. PRINT "Host name: "; hostName$
  5.  
  6. message$ = "Hello World"
  7.    clientHandle& = _OPENCONNECTION(hostHandle&)
  8.    LOCATE 5, 1: PRINT "ClientHandle from _openconnection: "; clientHandle&
  9.  
  10.    IF clientHandle& <> 0 then
  11.       PUT clientHandle&, , message$
  12.    END IF
  13.  
  14.    LOCATE 10, 1: PRINT TIMER
  15. LOOP UNTIL clientHandle& <> 0

And my client code to:
Code: QB64: [Select]
  1. FOR i = 1 TO 100
  2.     LOCATE 1, 1: PRINT "Connecting to port..."; i
  3.     clientHandle& = _OPENCLIENT("TCP/IP:53020:192.168.1.153")
  4.     LOCATE 2, 1: PRINT clientHandle&
  5.     IF clientHandle& <> 0 OR i > 100 THEN EXIT FOR

I am getting TCP/IP:53020:127.0.0.1 as hostName$. I'm wondering if the _OPENHOST isn't working properly if it's not saying the actual IP

3
QB64 Discussion / Re: OpenClient trouble
« on: May 30, 2020, 01:13:13 pm »
I have not done anything for my pc (client). Would I have to open the port on it too?

4
QB64 Discussion / Re: OpenClient trouble
« on: May 30, 2020, 01:08:22 pm »
So I looked around on the interweb and such and did a few things:
1. I typed "ip addr" and found the line inet 192.168.1.153/24 brd 192.168.1.255, and I assume the ip I use is the 192.168.1.153?
2. I went into my router settings and allowed port range forwarding for 52030-53030 to go to the above ip address.
3. I found my ipv6 address for the pi as fe80::b3e7:3018:6543:17a2/64 and I assume the address is everything before the /64?
4. I added that address into the firewall settings for my router to allow the above ports
5. I installed ufw on the rpi and ran "sudo ufw allow 53020"
6. I changed the port value in both programs to reflect the new port (and changed the IP address on the client side to the ipv4)

Still I can't get the client to connect. What other processes/hurdles need to be done that might stop this from working?

5
QB64 Discussion / Re: OpenClient trouble
« on: May 29, 2020, 10:38:17 pm »
Even if _openclient returns zero? I would assume something other than qb64 is wrong I just don't know how to narrow down the problem

6
QB64 Discussion / Re: OpenClient trouble
« on: May 29, 2020, 12:47:59 pm »
Hey Jack!
I am planning to connect a few computers to the pi at the same time on different local networks so I'm not sure if that is the best solution. I guess I can connect the two when I'm coding and testing locally but switch to wifi when the server is up and running (but at that rate I should just stick with wifi right?)
I appreciate it tho!

7
QB64 Discussion / OpenClient trouble
« on: May 29, 2020, 11:50:55 am »
Hello reader,
I am trying to get into networking and am starting simple by just trying to connect two programs on two different computers (my pc and a rpi). The rpi has this code:
Code: QB64: [Select]
  1. hostHandle = _OPENHOST("TCP/IP:8080")
  2. result$ = _CONNECTIONADDRESS$(hostHandle)
  3. LOCATE 1, 1: PRINT _CONNECTED(hostHandle)
  4. LOCATE 3, 1: PRINT result$

And my PC has:
Code: QB64: [Select]
  1. port = 8080
  2. counter = 0
  3.     'port = port + 1
  4.     counter = counter + 1
  5.     LOCATE 1, 1: PRINT port; counter
  6.     clientHandle& = _OPENCLIENT("TCP/IP:8080:127.0.0.1")
  7. LOOP UNTIL clientHandle& <> 0 OR counter > 100

With the rpi (host) program running (and the _OPENCLIENT address comes directly from result$), I try to run the client program. It tries to connect to the port 100 times but it still comes back with clientHandle& = 0.

My question is are there any settings in my pc I have to adjust in order to connect? What else might give the _OPENCLIENT trouble connecting?

Thank you

8
QB64 Discussion / Re: QB64 on RPI4 (4gb)
« on: May 28, 2020, 11:34:37 am »
So I downloaded the three libraries you said (freeglut3-dev, mesa-utils, and libsdl1.2-dev) and it is running. I'm trying to compile some of my old programs with much success and I'm ready for the next step of my project. If I get the gpio pins working I will explain what I did for others. If I run into a problem where I need to download another library (like in the case of libsdl1.2-dev), is there a list somewhere I can use as reference to find what I need?

Ps: Is there a linux version of ctrl+break for linux? I'm not sure if it's the keyboard I'm using for it requiring fn to get to break but I've been using ctrl+alt+d to go to the desktop then closing the app.

Pss: Thank you so much for your help. I am so relieved it is working

9
QB64 Discussion / Re: QB64 on RPI4 (4gb)
« on: May 27, 2020, 06:51:02 pm »
Is there any libraries for qb64 to gain access to the gpio pins? I wanted to run some status leds from the rpi since it will be running in the background without a monitor.

10
QB64 Discussion / Re: QB64 on RPI4 (4gb)
« on: May 27, 2020, 06:37:03 pm »
Thank you so much. I will try this when I get home and give an update.
Did you have to update this line in the setup_lnx.sh:

elif [ "$DISTRO" == "linuxmint" ] || [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] || [ "$DISTRO" == "zorin" ]; then
  echo "Debian based distro detected."

11
QB64 Discussion / Re: QB64 on RPI4 (4gb)
« on: May 27, 2020, 04:28:09 pm »
I did that and when I ran the setup I was gui location errors I believe. I will try again from scratch when I get home and see if I get those errors again. Also just for my piece of mind, what is the easiest way to install qb64 onto rpi4? I believe I downloaded the linux version onto my windows pc and copied it over on the sd card. I'm not sure if that is part of the reason I'm having issues.

12
QB64 Discussion / QB64 on RPI4 (4gb)
« on: May 26, 2020, 05:44:46 pm »
Hello reader,

My goal is to create a server to facilitate communications between different computers for mulitplayer games (online shooters, board games, baseball, ect.). I am very new to linux and not very comfortable doing anything outside of a tutorial and there isn't much online about this. I have tried what I have found but it's either not updated for rpi 4 or not enough information for me to connect the dots since I'm beyond a noob in this.

I have an RPI 4 (4gb) I am trying to use to do this but I can't seem to run anything useful. I have tried using wine (64 bit), and wine (32 bit) for linux to run the .exe files (the tutorial I used was
) . I have also tried to run qb64 for linux on it to try to compile my programs directly on it. I would like to use the RPI instead of getting a small windows computer if I can avoid it.

My options (in my mind and I'm probably wrong) are:
*Copy .exe files to rpi then use wine to run them
*Create a .exe like program to run on linux natively
*Try to put windows onto the RPI then run .exe (unlikely)
*Switch machines (Last resort)

I can get into much more detail of what I have and what I have tried to do as I am not sure what will help. I know some people got qb64 to run on the pi but I couldn't follow their instructions. https://www.qb64.org/forum/index.php?topic=1550.0

Any help would be much appreciated.

Pages: [1]