Connect appium server running on selenium grid to jenkins to run local test

I currently have a setup that is running appium test cases locally for a mobile application using android studio. I have tried to implement this into jenkins where i would use the jenkins slave to basically run the test for me locally. However it is not working and i get a Request Error timed out when trying to initiate the appium test in the jenkins log.
I figured maybe i need to set up a selenium server hub and node to work with Appium but that still does not connect my server to the jenkins slave.
For some background, i have the same set up for browsing testing where i have just specified my IP and its able to run the test cases on my local through jenkins slave using the selenium server.
Below is how i have set my capabilities, maybe im missing something code wise?

const capabilities = {
platformName: ‘Android’,
‘appium:automationName’: ‘UiAutomator2’,
‘appium:deviceName’: ‘Android’,
};

const wdOpts = {
hostname: ‘my IP’,
port: parseInt(process.env.APPIUM_PORT, 10) || 4723,
logLevel: ‘info’,
capabilities,
};

driver = await remote(wdOpts);