GithubHelp home page GithubHelp logo

kevinelliott / dji Goto Github PK

View Code? Open in Web Editor NEW
60.0 10.0 19.0 81 KB

CLI and Ruby tools for drone-maker DJI's store, account, and more

License: MIT License

Ruby 99.64% Shell 0.36%
ruby ruby-gem ruby-library dji drones uav

dji's Introduction

To support my open-source work, consider adding me on Patreon.

DJI

CLI and Ruby tools for drone-maker DJI's store, account, order status and more.

Installation

If you already have Ruby installed on your computer, you can install this. Otherwise, go install Ruby and come back to these instructions.

Open a command line (Terminal on macOS):

$ gem install dji

When updates are released, you can get them with:

$ gem update dji

If you do not manage your Ruby installations with RVM and are just using the system ruby, you might need to prefix the above commands with sudo, such as:

$ sudo gem install dji

If you are on Ubuntu Linux, you can do:

$ sudo apt install ruby ruby-dev
$ sudo gem install dji

Usage

Order Tracking

$ dji track [options]

REQUIRED:

  -o, --order ORDER_NUMBER    # Your order number
  -p, --phone PHONE_TAIL      # Last 4 digits of your phone number

OPTIONAL:
  
  -r, --repeat INTERVAL       # Repeat every INTERVAL seconds
  --publish                   # Publish your order details to http://dji-track.herokuapp.com/orders
  -c, --country COUNTRY       # Your country (use 3 letter code, such as USA)
  -t, --order_time TIMESTAMP  # The timestamp from your private order page at https://accounts.dji.com/user/orders surrounded by quotes (i.e. "2016-09-29 11:21:21 (UTC)")
  -u, --dji_username USERNAME # Your DJI Forum username
  -d, --debug                 # Some additional output used when emailing [email protected] for assistance

Example: Track an order

Use your order number in place of ORDER_NUMBER and the last 4 digits of your phone number for PHONE_TAIL. A full example might look like this:

$ dji track -o 123456789012 -p 1234

ORDER TRACKING AS OF 2016-10-27 01:12:27 -0700
------------------------------------------------------
Order Number     : 123456789012
Total            : USD $1,398.00
Payment Status   : Pay Confirmed
Shipping Status  : Pending
Shipping Company : Tba
Tracking Number  : 

Example: Track an order, every 60 seconds

If you want this to repeat automatically at an interval, specify the option for repeat (either -r or --repeat) with the number of seconds. Do not use this nefariously, I suggest a reasonable interval such as 60 seconds, but more useful is probably around 300 seconds (5 minutes) to 600 seconds (10 minutes).

$ dji track -o 123456789012 -p 1234 -r 60

Requesting order tracking details every 60 seconds. Press CONTROL-C to stop...

ORDER TRACKING AS OF 2016-10-27 01:29:36 -0700
------------------------------------------------------
Order Number     : 123456789012
Total            : USD $1,398.00
Payment Status   : Pay Confirmed
Shipping Status  : Pending
Shipping Company : Tba
Tracking Number  : 


ORDER TRACKING AS OF 2016-10-27 01:30:37 -0700
------------------------------------------------------
Order Number     : 123456789012
Total            : USD $1,398.00
Payment Status   : Pay Confirmed
Shipping Status  : Pending
Shipping Company : Tba
Tracking Number  : 

Example: Track an order, every 5 minutes, and publish details for others to see

$ dji track -o 123456789012 -p 1234 -r 300 --publish -u dronenerd -c USA

ORDER TRACKING AS OF 2016-10-27 01:12:27 -0700
------------------------------------------------------
DJI Forum Username : dronenerd
Order Number       : 123456789012
Total              : USD $1,398.00
Payment Status     : Pay Confirmed

   Country : USA Shipping Status : Pending Shipping Company : Tba Tracking Number :

You have successfully published your latest order status.
See order statuses reported by others at http://dji-track.herokuapp.com/orders

ORDER TRACKING AS OF 2016-10-27 01:17:28 -0700
------------------------------------------------------
DJI Forum Username : dronenerd
Order Number       : 123456789012
Total              : USD $1,398.00
Payment Status     : Pay Confirmed

   Country : USA Shipping Status : Pending Shipping Company : Tba Tracking Number :

You have successfully published your latest order status.
See order statuses reported by others at http://dji-track.herokuapp.com/orders

Search FedEx and track by reference

If you think your shipper is FedEx but you don't have a tracking code yet, you might be able to find your shipment by searching Fedex by reference. This allows you to search and track by reference.

$ dji track -c COUNTRY_CODE -p POSTAL_CODE

An example of searching in the USA (country code is us) with a postal code:

$ dji fedex -c us -p 94123

FedEx Packages for Country us, Postal Code 94123 as of 2016-10-27 03:44:37 -0700
-------------------------------------------------------------------------------------------------------

PACKAGE 1

Origin       : SHENZHEN, CN
Destination  : San Francisco, CA, US
Tendered     : 
Picked Up    : 
Shipped      : 2016-10-27 00:00:00 -0600
Est. Deliver : 2016-10-31 10:30:00 -0700
Dimensions   : 22x34x16 cms
Total Weight : 9.7 lbs (4.4 kgs)
Status       : Label created

If you want to search by a different reference, you can optionally pass it in:

$ dji fedex -c us -p 94123 --reference DJIGOODS

FedEx Packages for Country us, Postal Code 94123 as of 2016-10-27 03:50:57 -0700
-------------------------------------------------------------------------------------------------------

PACKAGE 1

Origin       : SHENZHEN, CN
Destination  : San Francisco, CA, US
Tendered     : 
Picked Up    : 
Shipped      : 2016-10-27 00:00:00 -0600
Est. Deliver : 2016-10-31 10:30:00 -0700
Dimensions   : 22x34x16 cms
Total Weight : 9.7 lbs (4.4 kgs)
Status       : Label created

You may also have it repeat the search on a regular interval (in seconds):

$ dji fedex -c us -p 94123 -r 120

Requesting FedEx tracking by reference DJIGOODS every 120 seconds. Press CONTROL-C to stop...

FedEx Packages for Country us, Postal Code 94123 as of 2016-10-27 03:53:41 -0700
-------------------------------------------------------------------------------------------------------

PACKAGE 1

Origin       : SHENZHEN, CN
Destination  : San Francisco, CA, US
Tendered     : 
Picked Up    : 
Shipped      : 2016-10-27 00:00:00 -0600
Est. Deliver : 2016-10-31 10:30:00 -0700
Dimensions   : 22x34x16 cms
Total Weight : 9.7 lbs (4.4 kgs)
Status       : Label created


FedEx Packages for Country us, Postal Code 94123 as of 2016-10-27 03:55:42 -0700
-------------------------------------------------------------------------------------------------------

PACKAGE 1

Origin       : SHENZHEN, CN
Destination  : San Francisco, CA, US
Tendered     : 
Picked Up    : 
Shipped      : 2016-10-27 00:00:00 -0600
Est. Deliver : 2016-10-31 10:30:00 -0700
Dimensions   : 22x34x16 cms
Total Weight : 9.7 lbs (4.4 kgs)
Status       : Label created

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/dji. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

dji's People

Contributors

danm72 avatar daveio avatar dependabot-support avatar kevinelliott avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dji's Issues

Track fails

OSX 10.12.1

gem -v
2.0.14.1

dji track -o XXXXXXXXXXXX -p XXXX
/Library/Ruby/Gems/2.0.0/gems/dji-0.7.4/lib/dji/order_tracking.rb:78:in tracking_details': undefined method text' for nil:NilClass (NoMethodError)
from /Library/Ruby/Gems/2.0.0/gems/dji-0.7.4/lib/dji/commands/track/track_command.rb:45:in track' from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:27:in run'
from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in invoke_command' from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in dispatch'
from /Library/Ruby/Gems/2.0.0/gems/dji-0.7.4/lib/dji/command/base.rb:33:in perform' from /Library/Ruby/Gems/2.0.0/gems/dji-0.7.4/lib/dji/command.rb:31:in invoke'
from /Library/Ruby/Gems/2.0.0/gems/dji-0.7.4/exe/dji:16:in <top (required)>' from /usr/local/bin/dji:23:in load'
from /usr/local/bin/dji:23:in `

'

fedex works

% dji fedex -c us -p 89074

FedEx Packages for Country us, Postal Code 89074 as of 2016-11-15 17:34:15 -0800

PACKAGE 1

Origin : SHENZHEN, CN, CN
Destination : HENDERSON, NV, US
Tendered : 2016-11-08 11:41:00 UTC
Picked Up : 2016-11-08 12:30:00 UTC
Shipped : 2016-11-09 06:00:00 UTC
Delivered : 2016-11-10 17:32:00 UTC
Dimensions : 11x11x5 in.
Total Weight : 4.85 lbs (2.2 kgs)
Status : Delivered

Mavic using Realtek RTL8723BS for SDR?

Hi Kevin, great work here. I had a question about what you have listed on the hardware page. Notably both the Realtek and Atheros chipsets being present. Do you know or suspect that DJI is using one of them purely for the OFDM comm link modulation and handling its Occusync protocol further up the protocol stack? Or did you find a true SDR/FPGA in there to handle the Occusync RF portion?

Thanks!

Have you considered brute forcing order numbers?

screen shot 2016-11-08 at 14 59 24

I'm not 100% on the structure of the order numbers, but mine is #61 in that screenshot and its prepended with 353 which is the country code for Ireland where i live.

Everyone else's seems to be 0011 and ascending from there. Surely we could get a better idea of the landscape if we bulk imported order numbers.

It will require brute forcing the mobile numbers too. Which is a 1/10000 chance, so the big question is around their rate limiting.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.