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

Faraday Software - Simple Scripts #246

Merged
merged 20 commits into from
Jul 13, 2017
Merged

Conversation

kb1lqd
Copy link
Contributor

@kb1lqd kb1lqd commented Jul 11, 2017

This Pull Request adds basic scripts to:

  • Program the FLASH memory of Faraday units
  • Configure and start various Faraday programs

from a single cross-platform (Windows/Linux) script respectively. These scripts are to be simplistic and will likely be replaced by a user-interface command program but until then these scripts provide a lot of functionality.

I've asked both @kb1lqc and @reillyeon to review but only one is really needed. I'd like someone else to at least run this is both Windows and Linux. Also, Should this be kicked back to adding support for Mac's as well?

Issue References

Copy link
Member

@kb1lqc kb1lqc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved but please make the simple changes I suggested.


# Proxy
proxy_callsign = 'REPLACEME'
proxy_nodeid = 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard configured nodeid?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, TravisCI fails otherwise. Adding a comment "Replace with proxy_nodeid of local unit to be programmed"

call(['faraday-deviceconfiguration', '--init-faraday-config']) # Initialize faraday configuration INI holding program settings

# Basics
call(['faraday-deviceconfiguration', '--proxycallsign', proxy_callsign, '--proxynodeid', str(proxy_nodeid), '--nodeid', str(proxy_nodeid), '--callsign', proxy_callsign])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are all these faraday-deviceconfiguration calls run at once or discretely?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discretely. Minimal efficiency drop and easier to read. I realize now we could optimize by just building a concatenated string and pulling one (or minimal needed in proxy case) call() functions. I think we can pass on this for the PR given low risk.


# Start servers
print ("--- STARTING PROXY SERVER ---")
print type(running_os), running_os == 'linux2'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must this change if you're running windows? Seems like it. At least comment that you need to change this. This also just looks like a comparison...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was old debug print I missed. Removed. line 63.

# Proxy
proxy_unitcnt = 1 # Number of units proxy is connecting to (starts at unit0)
proxy_unit0_callsign = 'REPLACEME'
proxy_unit0_nodeid = 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard coded nodeid?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep just like your prior comment. Updating with a comment "Replace with proxy_nodeid of local unit to be programmed"

print ("--- INITIALIZING PROXY SERVER ---")
call(['faraday-proxy', '--init-config'])
call(['faraday-proxy', '--unit', str(0), '--callsign', proxy_unit0_callsign, '--nodeid', str(proxy_unit0_nodeid), '--port', proxy_unit0_port])
#call(['faraday-proxy', '--unit', str(1), '--callsign', proxy_unit1_callsign, '--nodeid', str(proxy_unit1_nodeid), '--port', proxy_unit1_port]) # Uncomment if second unit
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be mentioning that these commented out lines are for a second radio.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment added.

@@ -0,0 +1,88 @@
# Faraday - Simple Scripts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note that these are largely development scripts and not meant for mainstream use at this time. Basically they are only available if you checkout git/download them manually and we assume you know what you're doing if you do that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted.

default_altitude='00000.00'
```

### GPS Defaults `DDMM.mmmm` format
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an awkward section. Also, longitude is DDDMM.mmmm while latitude is DDMM.mmmm

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, keeping as is for wording right now. Fixed notation.

DDMM.mmmm Lon (RAW) = `W 118 26.171`
```

Converting into a valid Faraday configuration:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This next conversion is confusing. What are you starting with? Why not just give an example from google maps provided coordinates:

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, added link and some text about getting coordinates from google maps. Conversion is the same. Pushing forwarding. Will update further if needed (getting questions from users).

@kb1lqc
Copy link
Member

kb1lqc commented Jul 11, 2017

Yes this works on Windows 7 as a development script. Definitely a bit rough around the edges but it's incredibly useful for dev work. I'd like to see it become some sort of program in the future. Likely just faraday.

One thing to note about GPS coordinates. I tried to convert:

34.055975, -118.246283

Into DDMM format and was told:

N 34 3.358, W 118 14.777

In reality this converts to:

default_latitude = '3403.3580'
default_longitude = '11814.7770'

I know you mentioned it in the readme but it's actually still not very clear that the latitude is '34' + '03'. That website should be giving the leading '0' for the '03'...

@kb1lqd kb1lqd merged commit e8c87ef into FaradayRF:master Jul 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants